Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Printing statements in new/next line

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-06-30 : 07:58:43
Nagendra writes "How do i print statements in different line.

eg. I have variable called @message. I added the value as 'Hi' to variable. When i print @message in SP it will print 'Hi'. I want to print 'How r u?' in next line from same variable.

Like in c# '\n' is used for new line. Is their any command in SQL."

dsdeming

479 Posts

Posted - 2005-06-30 : 08:04:38
Just use the char function with the ascii code for carriage return:

SELECT 'HI' + CHAR( 13 ) + 'HOW R U'
or
PRINT 'HI' + CHAR( 13 ) + 'HOW R U'

Dennis
Go to Top of Page
   

- Advertisement -