日期:2014-05-18 浏览次数:21263 次
if object_id('tempdb..#t') is not null drop table #t create table #t(a nvarchar(50)) declare @a int set @a = 1 while @a <= 120 begin insert into #t(a) values('Employees.Number as [工號]★') set @a = @a + 1 end --print len('Employees.Number as [工號]★') * 120 select '' + a + '' from #t for xml path('')
select len((select '' + a + '' from #t for xml path(''))) /**************** 3000
------解决方案--------------------
测试结果都是3000呀,
if object_id('tempdb..#t') is not null drop table #t create table #t(a nvarchar(50)) declare @a int set @a = 1 while @a <= 120 begin insert into #t(a) values('Employees.Number as [工號]★') set @a = @a + 1 end select len('Employees.Number as [工號]★') * 120 'len1' select len((select '' + a + '' from #t for xml path(''))) 'len2' len1 ----------- 3000 len2 -------------------- 3000
------解决方案--------------------
如果正常的长度是8000呢??出来的长度是多少?
------解决方案--------------------
你数据库的查询选项--结果--网格 里面检索最多的字符数XML数据设置大一点
------解决方案--------------------
if object_id('tempdb..#t') is not null drop table #t create table #t(a nvarchar(50)) declare @a int set @a = 1 while @a <= 120 begin insert into #t(a) values('Employees.Number as [工號]★') set @a = @a + 1 end -- print len('Employees.Number as [工號]★') * 120 select '' + a + '' from #t for xml path('') select len('Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Employees.Number as [工號]★Emp