Return to Snippet

Revision: 8937
at October 14, 2008 13:55 by hoffstein


Initial Code
IF EXISTS (
    SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_NAME = 'p_MyProc' 
    AND ROUTINE_SCHEMA = 'dbo'
    AND ROUTINE_TYPE = 'PROCEDURE'
) 
BEGIN
    DROP PROCEDURE dbo.p_MyProc
    PRINT 'Dropped dbo.p_MyProc'
END

Initial URL

                                

Initial Description

                                

Initial Title
TSQL delete proc if it already exists

Initial Tags

                                

Initial Language
SQL