This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while(exists(select 1 from INFORMATION_SCHEMA.VIEWS where TABLE_SCHEMA != 'sys')) | |
begin | |
declare @sql nvarchar(2000) | |
SELECT TOP 1 @sql=('DROP VIEW [' + TABLE_SCHEMA + '].[' + TABLE_NAME | |
+ ']') | |
FROM INFORMATION_SCHEMA.VIEWS | |
WHERE TABLE_SCHEMA != 'sys' | |
exec (@sql) | |
PRINT @sql | |
end |