Skip to content

Commit dd65643

Browse files
authored
Add files via upload
1 parent 7d9cdea commit dd65643

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SSDB.Script_Refresh_Views.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SELECT DISTINCT
2+
'EXEC sp_refreshview ''' + sc.name + '.' + so.name + '''' AS IndividualScript
3+
FROM sys.objects AS so
4+
INNER JOIN sys.schemas sc ON sc.schema_id = so.schema_id
5+
INNER JOIN sys.sql_dependencies AS sed
6+
ON so.object_id = sed.object_id
7+
WHERE so.type = 'V'
8+
--AND OBJECT_NAME(sed.referenced_major_id) LIKE 'MyTable%'

0 commit comments

Comments
 (0)