您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

交叉制表--检查列的计数值和长度并加入行数据(9)

2024/5/3 7:38:40发布36次查看
交叉制表--检查列的计数值和长度并加入行数据(9) 交叉表 --除了需要证实列的计数值和名称长度,如果一切正常用户还需要填写#rownames表--check column countif (select count(*) from #colnames)1023begin drop table #colnames raiserror 51004 'distinct co
交叉制表--检查列的计数值和长度并加入行数据(9)
交叉表 --除了需要证实列的计数值和名称长度,如果一切正常用户还需要填写#rownames表--check column countif (select count(*) from #colnames)>1023begin drop table #colnames raiserror 51004 'distinct column count exceeded max of 1023' return -1end--verify colnames do not exceed max lengthif (select max(datalength(rtrim(colname))-1) from #colnames)>29begin drop table #colnames raiserror 51050 'column data length exceeded max of 30' return -1end--if all is ok ,continue to add #rownames dataselect @chvexec='insert #rownames select distinct '+ case @introwtype when 1 then 'convert(varchar(255),' else '' end +rtrim(@chrrowhead)+ case @introwtype when 1 then ')' else '' end +'from '+@chrsource--print @chvexecexec(@chvexec)
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product