--删除存储过程
while exists(select name from sysobjects where type=´p´ and status>=0) 【程序编程相关:深入剖析java类的构造方式】declare @string varchar(8000) 【推荐阅读:Java的秘密:将应用程序的设定存在哪里】 select top 1 @string=´drop procedure ´+name from sysobjects where type = ´p´ and status>=0 【扩展信息:值交换的两种方法及其效率分析】begin --select @string exec(@string)endgo
--默认值或 default 约束
declare @string varchar(8000)while exists(select name from sysobjects where xtype=´d´)begin select top 1 @string=´alter table ´+b.name+´ drop constraint ´+a.name from (select parent_obj,name from sysobjects where xtype=´d´) a, (select id,name from sysobjects where objectproperty(id, n´isusertable´) = 1) b where a.parent_obj=b.id exec(@string)endgo
... 下一页