CR, LF, and Copy-paste in SSMS Query Results

Fun tidbit from a co-worker this week, very helpful if you’re not exporting right to Excel from the results context menu.

In SSMS:
Under Tools > Options

  1. Expand Query Results > SQL Server > Results to Grid
  2. Tick Retain CR/LF on copy or save
  3. Restart SSMS

This will cause CR, LF, and CRLF to be treated as newlines when you copy a cell.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.