String concatenation and dynamic sql

Why is the following SQL
SET @SQL =	'UPDATE ' + @table + ' ' +
			'SET [col1] = ''UNKNOWN'' ' + 
			'WHERE [col1] IS Null'

reformatted to
SET @SQL = 'UPDATE ' + @table + ' ' + 'SET [col1] = ''UNKNOWN'' '
    + 'WHERE [col1] IS Null'

Why is the + 'SET [col1] = ''UNKNOWN'' ' moved to the top line?

And how can I stop it?

Comments

  • The option that is laying your string concatenation as shown in your code is: General > Wrapping.

    There is no specific option to lay out string concatenation but the wrapping will affect it. If you decrease the amount of characters in the wrapping option then it will layout your code as you want. If you increase it then it will place the entire string concatenation on one line. However, the wrapping will also affect other parts of your code that you've selected.
Sign In or Register to comment.