This is a discussion on How to delete all stored procedures in a Database within the Database Support forums, part of the Web Development category; Hi, I want to delete all stored procedures in a Database. Can anyone give me the query to do this?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, I want to delete all stored procedures in a Database. Can anyone give me the query to do this?
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
| Sponsored Links |
| |||
| Hi, This is the simple way to do this. Use Database name 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
__________________ S.Balasubramanian Nothing is impossible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using arrays in stored procedures | it.wily | Database Support | 2 | 02-09-2008 10:18 AM |
| SQL Server Undocumented Stored Procedures | a.deeban | Database Support | 2 | 12-23-2007 11:20 PM |
| Using arrays in stored procedures | oxygen | Database Support | 1 | 11-26-2007 08:01 AM |
| SQL Server Undocumented Stored Procedures | a.deeban | Database Support | 3 | 09-04-2007 03:31 AM |
| Executing SQL Server Stored Procedures With PHP - Executing stored procedures | Jeyaseelansarc | PHP Programming | 1 | 07-19-2007 12:23 AM |