打印中的varchar(max)变量的不同输出,并在SQL Server中选择

Roh*_*hit -1 t-sql sql-server sql-server-2008

我们在这种情况下声明了varchar(max)变量,并在此之后分配了数据,以便将该值插入表中以供进一步使用.但是当我们选择数据时,我们得到了截断的数据.

declare @check varchar(max)

set @check = 'Calc saves your document as a file in your file system. If you open such a file in a plain text editor, you will immediately see that it is an XML document. Look at this plain file and find out where the interesting data is located. Target those elements with XSLT templates. Please note: I can only point you in the right direction, your question as such is too vague and broad for Stackoverflow.'
print @check 
select @check 
Run Code Online (Sandbox Code Playgroud)

结果:

Calc saves your document as a file in your file system. If you open such a file in a plain text editor, you will immediately see that it is an XML document. Look at this plain file and find out where the interesting data is located. Target those elements with XSLT templates. Please note: I can only point you in the right direction, your question as such is too vague and broad for Stackoverflow.

Calc saves your document as a file in your file system. If you open such a file in a plain text editor, you will immediately see that it is an XML document. Look at this plain file and find out where the interesting data is located. Target those elements w

(1 row(s) affected)
Run Code Online (Sandbox Code Playgroud)

在输出select @check中给出截断结果.我想用来select @check插入表格.有任何解决方法吗?

Mar*_*rtW 5

它被截断,因为Management Studio不一定会将完整值输出到屏幕,并且默认显示宽度为256个字符,这是您发生截止的地方:

SSMS选项屏幕

变量本身的值不受影响.