Introduction : In this article i will explain how to delete all the user defined Stored Procedures from your Sql Server database.
Description: In previous articles i explained How to delete all tables from Sql server Database and How to delete all views from sql server database and How to delete all triggers from sql server database . Now i am going to share the command to delete all the created stored procedure from the Sql Server database.
Note: This command will delete all the stored procedures from your database so use with care.
Implementation: In Sql Server execute the following command:
Description: In previous articles i explained How to delete all tables from Sql server Database and How to delete all views from sql server database and How to delete all triggers from sql server database . Now i am going to share the command to delete all the created stored procedure from the Sql Server database.
Note: This command will delete all the stored procedures from your database so use with care.
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
1 comments:
Click here for commentsyour welcome saliman. Subscribe and stay tuned for more updates
If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily..