You are here: Home > Technical Articles > MS SQL Server - Drop Function If Exists

MS Sql Server - Drop Function If Exists


SQL Script for dropping a user defined function if it exists.

IF EXISTS (SELECT * FROM sysobjects WHERE name = 'f_fix_ip' AND type = 'FN')
BEGIN
    DROP FUNCTION f_fix_ip
END
GO


Published On: 02 Aug 2009