is there a way I can write a script to find all tables with a given filter (e.g. all tables that start with “tbl_”) and copy them (structure only) but adding a new standard column to each one?
I’m using SQL server 2008.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes
Use the Metadata: INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS
Generate table creation scripts in a different schema or database or table name with the additional columns