Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert a line break to produce data on multiple rows: SQL 2008 TSQL

Status
Not open for further replies.

CarolCook

IS-IT--Management
Mar 7, 2003
158
US
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top