This could be a very risky script for people to use for two reasons:
* Column Names are typed SYSNAME, which is NVARCAHR(128) , not VARCAHR(30)
* You use dynamic SQL without QUOTENAME(), which means your script could fail on column names that are not regular identifiers.