Skip to main content

Checks to see if a SQL Server function exists and deletes it if it does.

if object_id(N'<schema>.<function>', N'FN') is not null
begin
    print 'Dropping function <schema>.<function>'
    drop function <schema>.<function>;
end;