0

I'm running a query inside a an SP to build a line of text eg:

SELECT 'Heading1' + CHAR(9) + 'Heading2' + CHAR(9) + 'Heading3' AS TextLine
UNION
SELECT String1 + CHAR(9) + String2 + CHAR(9) + String3 AS TextLine
FROM SourceTable etc etc

The results go to a grid, however, when I copy and paste the results from the results grid and paste them into Notepad the TABS are converted to a single space.

I can correct this behavior by sending the results to text rather than a grid, however, a colleague gets the tabs even when the results go to a grid so we must have different settings somewhere. Any idea what the setting may be as I cant see anything obvious in the Query->Query Options menu.

Thanks in advance for any help :-)

Thom A
  • 88,727
  • 11
  • 45
  • 75
JeffD
  • 1
  • 1
  • Do you have the "Retain CR/LF on copy or Save" setting switched on? I would suggest not. – Thom A Apr 13 '22 at 09:45
  • It was already set to that setting and I have restarted SSMS many times since creating query. – JeffD Apr 13 '22 at 09:57

0 Answers0