Drop all Functions for Single Instance of Microsoft SQL Server
PRINT 'delete all user defined functions'
DECLARE @fn varchar(255)
WHILE (
SELECT Count(*) from dbo.sysobjects f
WHERE type = 'FN' AND f.name not like 'fn[_]%diagram%'
) > 0
BEGIN
SET @fn = (
SELECT TOP 1 name from dbo.sysobjects f
WHERE type = 'FN' AND f.name not like 'fn[_]%diagram%'
)
SET @fn = 'DROP FUNCTION ' + @fn
PRINT @fn
EXEC(@fn)
END