How to insert New Line in SQL String

 

For inserting New Line Character just insert CHAR(13) to your sql string

Example:
DECLARE @strPrint VARCHAR(100); 
SET @strPrint = 'Example of New Line ';
SET @strPrint = @strPrint + CHAR(13);
SET @strPrint = @strPrint + ' is here';
PRINT @strPrint;
GO

Result:

Example of Example of New Line
is here

Advertisements