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


create procedure dropallsp as
declare @procName varchar(500)
declare cur cursor
for Select [name] from sys.procedures where [type] = 'P' and is_ms_shipped = 0 and [name] not like 'sp[_]%diagram%'
open cur
fetch next from cur into @procName
while @@fetch_status = 0
begin
exec('drop procedure ' + @procName)
fetch next from cur into @procName
end
close cur
deallocate cur
Shout it kick it on DotNetKicks.com
0
Responses to ... SQL Query to Delete all stored procedures in a database