Uncategorized

Drop all functions in database

DECLARE @Stmt NVARCHAR(MAX)

SET @Stmt = ''

SELECT  @Stmt = @Stmt + 'DROP FUNCTION [' + s.name + '].[' + o.name + '];' 
FROM sys.objects o
	INNER JOIN sys.schemas s ON s.schema_id = o.schema_id
WHERE type_desc LIKE '%FUNCTION%'

EXECUTE (@Stmt)
GO

SELECT * FROM sys.objects WHERE type_desc LIKE '%FUNCTION%'
GO