DECLARE @TabName varchar(100)
Declare @T1 varchar(100)
DECLARE Refereshview CURSOR FOR select table_name from information_schema.views
OPEN Refereshview
FETCH NEXT FROM Refereshview INTO @TabName
WHILE @@FETCH_STATUS = 0
BEGIN
set @t1=@TabName
exec sp_refreshview @t1
print @t1
Fetch NEXT FROM Refereshview INTO @TabName
END
CLOSE Refereshview
DEALLOCATE Refereshview
No comments:
Post a Comment