Transact SQL - VARCHAR(8000) Data Type
I've coded the Tran_GenerateColumnList stored procedure to dynamically create a comma delimited list of column values to be passed into an execution call where the columns exist in both the View and the Table. This database has a lot of columns on a particular table and I am exceeding the 8000 character limit for the VARCHAR data type. Any suggestions on a possible work around? Do I need to use 开发者_高级运维LEN and create a second variable to concatenate to the first variable? Any input would be greatly appreciated.
http://pastebin.com/kRDevWTD
Are you on SQL Server 2005 or higher? If so, can't you use varchar(max)
? See also SQL Server: When 8000 Characters Is Not Enough for ideas if you are indeed stuck on pre 2005
精彩评论