您的位置:首页 > 数据库

T-Sql语句删除全部存储过程

2011-12-07 22:53 295 查看
select distinct name from table打开重复记录的单个字段
select * from table where fid in(Select min(fid) FROM table group by name)打开重复记录的所有字段值
select * from table where name in(select name from table group by name having count(name)=1)打开重复任意次数的所有记录

×××××××××××××××××××××××××××××××××××××××××
删除全部存储过程
----------------------------------------------------------------------------------------------
declare @procName varchar(500)
declare cur cursor
for select [name] from sys.objects where type = 'p'
open cur
fetch next from cur into @procName
while @@fetch_status = 0
begin
if @procName <> 'DeleteAllProcedures'
exec('drop procedure ' + @procName)
fetch next from cur into @procName
end
close cur
deallocate cur
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: