0
SELECT MI_CTIT_QUERIES.CTIT_QERY_SOURCE_MEM
, REPLACE(SUBSTRING(MI_CTIT_QUERIES.CTIT_QERY_SOURCE_MEM, 7, (LEN(MI_CTIT_QUERIES.CTIT_QERY_SOURCE_MEM) - 418)), ',', CHAR(10)) "Base Query"
, MI_CTIT_QUERIES.CTIT_KEY
FROM MI_CTIT_QUERIES
WHERE MI_CTIT_QUERIES.CTIT_KEY = 14298604

Above is the query I have built to provide me results wherever it finds comma it will put the next string to new line but its just creating a tab

enter image description here

The String should appear as

'Do not edit' "Do not edit" newline [MI_EVWKHIST].[MI_EVENT_TYP_CHR] "Order Type Code" and so on...

  • isn't ms stuff usually uses `cr` (`\r`) and `lf` (`\n`) in pair? afaik, smss (by default) only shows row content single line regardless new line existence.. have you tried to print them somewhere outside? – Bagus Tesa Dec 30 '22 at 10:55
  • I need this in SSRS Report thus new line is required – Chirantan Mandal Dec 30 '22 at 11:14
  • No, @BagusTesa , for a literal `'\r'` and `'\n'` would be read as both literal values. Either the literal string needs to contain the relevant characters, or you can use `CHAR(13)` and `CHAR(10)` for Carriage Return and Line Feed respectively – Thom A Dec 30 '22 at 12:41
  • Its resolved, I think display is showing fine with print and final results in ssrs report – Chirantan Mandal Jan 02 '23 at 11:31

0 Answers0