Formatting the PRINT statement?

Last Post 28 Nov 2012 07:49 AM by gunneyk. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
new2sql
New Member
New Member

--
28 Nov 2012 06:04 AM
I've been trying to format the PRINT statement with tabs, spaces, etc... anything to help things appear a bit more uniform.

Are there any cool tips for this?

I'm not looking for Reporting Service solutions or any of that. Just something around the PRINT statement if possible.

Thanks in advance.
gunneyk
New Member
New Member

--
28 Nov 2012 07:49 AM
You can declare a variable and concatenate the string the way you want and then print the variable.

DECLARE @SQL VARCHAR(1000) ;
SET @SQL = 'This is Line 1:' + CHAR(10) + CHAR(13) ;
SET @SQL = @SQL + 'This is Line 2' ;
PRINT @SQL ;


Acceptable Use Policy
---