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
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
相关文章推荐
- SQL语句删除全部表、及存储过程的方法
- 删除数据库所有存储过程的SQL语句 转
- SQL 2000删除和恢复危险存储过程的语句
- 删除数据库所有存储过程的SQL语句
- 利用SQL语句创建、修改、执行、删除存储过程
- 一次性删除数据库所有表和所有存储过程 SQL语句
- 一次性删除数据库所有表和所有存储过程 SQL语句
- 删除数据库所有存储过程的SQL语句
- 删除数据库所有存储过程的SQL语句
- 删除数据库中所有存储过程和函数的sql语句
- 一次性删除数据库所有表和所有存储过程 SQL语句
- 删除数据库所有存储过程的SQL语句
- 一次性删除数据库所有表和所有存储过程 SQL语句
- 删除数据库所有存储过程的SQL语句
- 存储过程中传递动态Sql语句
- 存储过程执行删除重复数据、动态执行sql、拼接sql
- 执行字符串SQL语句--带有参数的存储过程以及 int类型的字符串变量注意事项
- 一个存储过程:带参数动态执行sql语句:Execute Immediate
- Mysql 动态sql语句返回结果集-存储过程
- SQL存储过程恢复与删除收集