Saturday, September 22, 2012

Drop all stored procedure from a database



-- Using below script you can drop all stored procedure from selected database
 


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
       exec('drop procedure ' + @procName)
       fetch next from cur into @procName
    end
close cur
deallocate cur

No comments:

Post a Comment

Managing Session Integrity in .NET Core Web Applications: A Middleware Approach

 In our journey of developing a .NET Core web application, we encountered a peculiar challenge with our time-tracking feature. The applicati...