谢谢4楼的。对于创建触发器刚才已经在参考手册中找到了方法“Select A.text From syscomments A Where A.id in (Select B.id From syscomments B Where B.text like '%CREATE TRIGGER%')”,在syscomments表中的text字段存放了触发器的SQL语法,但是text字段类型为char(255),所以一个触发器的语法会有多条记录,在检索回的语句中可能会出现“Select @ls_Discount=A.Discou
nt, @ls_FloatLevel=A.FloatLevel这样的语句A.Discou和nt在两行且还有空格,这样的语句执行会有问题吗?
select 'drop index '+object_name(id)+'.'+name+char(10)+'go' from sysindexes where id in (select id from sysobjects where type='U')这是drop index的脚本
一次性生产所有create的脚本,你可以借助其他工具,或者自己写东西