SQL Server 2008的常用高级脚本
(1) 每个表全部加上一个字段
EXEC sp_MSforeachtable '
if not exists (select * from sys.columns
where object_id = object_id(''?'')
and name = ''Server'')
begin
ALTER TABLE ? ADD [Server] [nvarchar](max) COLLATE Chinese_PRC_CI_AS NULL
end';