Cross tabulation-check the column count value and length and add row data (9)

Source: Internet
Author: User
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.