sqlserver 删除所有存储过程的方法

select identity(int,1,1) flag,[name] names into #tmp
from sysobjects where xtype='p'
--第二步循环删除
declare @tb varchar(1000) ,@a int,@b int,@sql varchar(8000)
select @a=min(flag),@b=max(flag) from #tmp
while @a<=@b
begin
select @tb=names from #tmp where flag=@a
set @sql='drop Procedure '+@tb
print @sql
exec(@sql)
set @a=@a+1
end
drop table #tmp

号在每次表的架构更改时都增加。
stats_schema_
ver int 保留。仅限内部使用。
type char(2) 对象类型。可以是下列值之一:
C = CHECK 约束
D = 默认值或 DEFAULT 约束F = FOREIGN KEY 约束
FN = 标量函数
IF = 内嵌表函数
K = PRIMARY KEY 或 UNIQUE 约束
L = 日志
P = 存储过程
R = 规则
RF = 复制筛选存储过程
S = 系统表
TF = 表函数
TR = 触发器
U = 用户表
V = 视图
X = 扩展存储过程

userstat smallint 保留。
sysstat smallint 内部状态信息。
indexdel smallint 保留。
refdate datetime 留作以后使用。
version int 留作以后使用。
deltrig int 保留。
instrig int 保留。
updtrig int 保留。
seltrig int 保留。
category int 用于发布、约束和标识。
cache smallint 保留。

posted on 2011-03-04 17:50  追_风  阅读(685)  评论(0编辑  收藏  举报

导航