Skip to content

String concate with max line width

Tako Lee edited this page Feb 17, 2014 · 3 revisions

Enable max length of each line for a string concatenate expression. Here is a sample of concatenate expression set to 40 characters.

SELECT 'This' + ' is a sample' 
       + ' of the concatination' 
       + ' strings that are "nicly"' 
       + ' formatted in the orignal code' 
       + ' but SQL Pretty Printer' 
       + ' puts into one line' + Char(10) + Char(13) 
       + 'Please consider how the orignal' 
       + ' formatting may be maintained and\or' 
       + ' adding options to adjust formatting' 
       + ' of strings like this including the' 
       + ' use of variables such as the system table name ''' 
       + name + '''' 
       + ' and the char(10) and char(13) line options.' 
       + Char(10) + Char(13) 
FROM   sys.objects 
Clone this wiki locally