January 11, 2018 at 8:53 pm
Comments posted to this topic are about the item SQL Server All View Refresh
SQL Server Consultant
yusufkahveci@sqlturkiye.com
www.sqlturkiye.com
January 14, 2018 at 7:25 pm
So, what happens when the view is in a schema other than the default schema of the user using the script? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
June 5, 2018 at 11:35 am
How about this
DECLARE
@sqlTrexec NVARCHAR(MAX)='';
SELECT @sqlTrexec = @sqlTrexec + '
EXECUTE sp_refreshview N''' + QUOTENAME( SS.Name ) + '.' + QUOTENAME( SO.Name ) + ''';'
FROM sys.objects AS SO
INNER JOIN sys.schemas AS SS ON SO.SCHEMA_ID = SS.SCHEMA_ID
WHERE SO.TYPE='V'
ORDER BY SS.Name, SO.Name;
EXECUTE (@sqlTrexec);
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply