I need a single query to produce output on two lines. The output needs to be copied into Excel with headers. I tried inserting char(13) and char(10) but that does not make the output break.
Any help is appreciated.
Thanks
Are you running the query in SQL Server Management Studio and expecting to see the data on multiple lines? If so, you need to change the "Results To".
Right click in the query window.
Click "Results to"
Click "Results to text"
Run your query again. Char(13) and Char(10) should produce a carriage return and line feed, making the output appear on multiple lines.
-George
Microsoft SQL Server MVP My Blogs SQLCop twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
Unfortunately, I needed the results to grid so that they could go to Excel. I wound up just using my query in a Crystal Reports command line which gave me the two line Excel output.
Thanks!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.