Monthly Archives: January 2012
How to delete all stored procedures from MSSQL database using cursor
| January 24, 2012 | Posted by Matt under SQL |
Here is a code for deleting all stored procedures in SQL Server database using cursor. DECLARE @name varchar(500) DECLARE @sql varchar(max) SET @sql = ” DECLARE cur CURSOR FOR SELECT [name] FROM sys.procedures OPEN cur FETCH NEXT FROM cur INTO @name WHILE @@fetch_status = 0 BEGIN SET @sql = ‘DROP PROC ‘ + @name PRINT…
I am IT professional with over 10 years of experience in computer programming and web development, specializing in Microsoft technologies.



Recent Comments