开发者

Script to copy SQL server table structures (filter + add columns)

开发者 https://www.devze.com 2023-01-08 00:15 出处:网络
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 the开发者_高级运维m (structure only) but adding a new standard column to

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 the开发者_高级运维m (structure only) but adding a new standard column to each one?

I'm using SQL server 2008.

Thanks in advance.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消