This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Retry INT; | |
SET @Retry = 3; | |
SET DEADLOCK_PRIORITY LOW; | |
WHILE (@Retry > 0) | |
BEGIN | |
BEGIN TRY | |
--Code that can deadlock | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Stored Procedures | |
PRINT 'Dropping Stored Procedures' | |
DECLARE @sqlDropProcedure NVARCHAR(MAX) = N''; | |
SELECT @sqlDropProcedure += 'DROP PROCEDURE [' + OBJECT_SCHEMA_NAME(object_id) + '].[' + name + ']; ' | |
FROM sys.procedures | |
WHERE is_ms_shipped = 0 | |
ORDER BY OBJECT_SCHEMA_NAME(object_id), name; | |
EXEC sp_executesql @sqlDropProcedure; |