Sql Server 2005/2008 删除数据库中所有存储过程

  
    
1 DECLARE @STRING VARCHAR ( 8000 )
2 WHILE EXISTS ( SELECT NAME FROM SYSOBJECTS WHERE TYPE = ' P ' AND STATUS >= 0 and uid = 1 )
3 BEGIN
4 SELECT TOP 1 @STRING = ' DROP PROCEDURE ' + NAME FROM SYSOBJECTS WHERE TYPE = ' P ' AND STATUS >= 0 and uid = 1
5 -- SELECT @STRING
6 EXEC ( @STRING )
7 END

 

你可能感兴趣的:(sql server 2005)