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 @sql EXEC (@sql) FETCH NEXT FROM cur INTO @name END CLOSE cur DEALLOCATE cur