Cross tabulation -- check the column's Count value and length and add row data (9) cross tabulation -- in addition to the Count value and Name Length of the column to be confirmed, if everything is normal, you still need to enter the # rownames table -- checkcolumncountif (selectcount (*) from # colnames) 1023 begindroptable # colnamesraiserror51004distinctco
Cross tabulation -- check the column's Count value and length and add row data (9) cross tabulation -- in addition to the Count value and Name Length of the column to be confirmed, if everything is normal, you still need to fill in # rownames table -- check column countif (select count (*) from # colnames) 1023 begin drop table # colnames raiserror 51004 'distinct co
Cross tabulation-check the column count value and length and add row data (9)
Cross tabulation
-- In addition to verifying the column count value and name length, if everything is normal, you need to enter the # rownames table -- check column countif (select count (*) from # colnames)> 1023 begin 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)> 29 begin 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)