Return to Snippet

Revision: 8938
at October 14, 2008 13:56 by hoffstein


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

Initial URL

                                

Initial Description

                                

Initial Title
TSQL delete function if it already exists

Initial Tags

                                

Initial Language
SQL