0
Posted on 5:20 AM by prajeesh and filed under ,
Here is the SQL query to create a stored procedure that deletes all stored procedures in a database
  1. create procedure dropallsp as  
  2. declare @procName varchar(500)  
  3. declare cur cursor  
  4. for Select [name] from sys.procedures where [type] = 'P' and is_ms_shipped = 0 and [name] not like 'sp[_]%diagram%'  
  5. open cur  
  6. fetch next from cur into @procName  
  7. while @@fetch_status = 0  
  8. begin  
  9. exec('drop procedure ' + @procName)  
  10. fetch next from cur into @procName  
  11. end  
  12. close cur  
  13. deallocate cur  
Shout it kick it on DotNetKicks.com
0
Responses to ... SQL Query to Delete all stored procedures in a database