首页 > 其他 > 详细

针对字符串长度超过8000的处理

时间:2019-09-06 13:14:56      阅读:107      评论:0      收藏:0      [点我收藏+]

if (exists (select * from sys.objects where name = ‘up_test‘))
drop proc up_test
go
Create PROC [dbo].[up_test]
as
declare @SQL nvarchar(max), @SQL1 nvarchar(4000), @SQL2 nvarchar(4000), @SQL3 nvarchar(4000),
@SQL4 nvarchar(4000);
set @SQL1 = N‘SQl语句1‘ ;  -- 长度不能超过4000; 
set @SQL2 =‘SQL语句2‘;     -- 长度不能超过4000; 

set @SQL3 =‘SQL语句3‘;     -- 长度不能超过4000; 

set @SQL4 =‘SQL语句4‘;     -- 长度不能超过4000; 

 

set @SQL = concat(@SQL1, @SQL2, @SQL3, @SQL4);
exec SP_EXECUTESQL @SQL;

关于SP_EXECUTESQL 更详尽用法 参见 

https://www.cnblogs.com/lonelyxmas/p/7975445.html
--print len(@sql);
--print @SQL;
--print @sql1;
--print @sql2;
--print @sql3;
--print @sql4;
GO

针对字符串长度超过8000的处理

原文:https://www.cnblogs.com/adsoft/p/11474000.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!