这似乎很简单…
如何存储多行字符串以使代码保持良好的格式。
这样做很难看
DECLARE @myStr NVARCHAR(MAX)
SET @myStr = 'This represents a really long
string that i need multiple lines for,
dude.'
但上述结果会产生正确的字符串输出:
SELECT @myStr
'This represents a really long string that i need multiple lines for, dude.'
这样做可以更容易地阅读我的代码:
DECLARE @myStr NVARCHAR(MAX)
SET @myStr = 'This represents a really long
string that i need multiple lines for,
dude.'
但结果是:
SELECT @myStr
'This represents a really long string that i need multiple lines for,
dude.'
在多行字符串中是否有特殊的方法来转义制表符(就像其他语言一样…)