Drop all synonyms in database
13. 8. 2018
DECLARE @Stmt NVARCHAR(MAX) SET @Stmt = ” SELECT @Stmt = @Stmt + ‘DROP SYNONYM [‘ + s.name + ‘].[‘ + v.name + ‘];’ FROM sys.synonyms v INNER JOIN sys.schemas s ON s.schema_id = v.schema_id EXECUTE (@Stmt) GO SELECT * FROM sys.synonyms GO