Formatting the PRINT statement?

Last Post 28 Nov 2012 08:49 AM by gunneyk. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
new2sql
New Member
New Member

--
28 Nov 2012 07: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 08: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 ;
You are not authorized to post a reply.

Acceptable Use Policy