drop all function in sql server database
Declare @sqlExecute NVARCHAR(MAX) = N'';
SELECT @sqlExecute = @sqlExecute + N' DROP FUNCTION '
+ QUOTENAME(SCHEMA_NAME(schema_id))
+ N'.' + QUOTENAME(name)
FROM sys.objects
WHERE type_desc LIKE '%FUNCTION%';
print @sqlExecute
Exec sp_executesql @sqlExecute
GO
Declare @sqlExecute NVARCHAR(MAX) = N'';
SELECT @sqlExecute = @sqlExecute + N' DROP FUNCTION '
+ QUOTENAME(SCHEMA_NAME(schema_id))
+ N'.' + QUOTENAME(name)
FROM sys.objects
WHERE type_desc LIKE '%FUNCTION%';
print @sqlExecute
Exec sp_executesql @sqlExecute
GO
No comments:
Post a Comment