What does char(10) do in a dynamic t-sql string?
I have a dynamic sql st开发者_运维百科ring in a existing procedure. What does the char(10) do?
Set @SelectStr = @SelectStr + ' And FC.FCode = ''' + @FCode + '''' + CHAR(10)
CHAR(10)
is the character represented by ASCII code 10, which is a Line Feed (\n) so its a new line.
(Although its not the windows standard new line which is Carriage Return + Line Feed CHAR(13)+CHAR(10)
)
In your example its probably just used to make the string more readable when its printed out.
精彩评论