Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a Line break in a SQL Server Stored Procedure?

I'm making a Stored Procedure that basically concatenates a long string with data from many records.

I want to do:

set @output = @output + 'aaa' + LINEBREAK

How do I specify that line break?

like image 949
Daniel Magliola Avatar asked Oct 08 '08 05:10

Daniel Magliola


2 Answers

DECLARE @LINEBREAK AS varchar(2)
SET @LINEBREAK = CHAR(13) + CHAR(10)
like image 88
Cade Roux Avatar answered Sep 21 '22 15:09

Cade Roux


Try this:

set @output = @output + 'aaa' + char(13)
like image 40
Matt Hamilton Avatar answered Sep 18 '22 15:09

Matt Hamilton