Skip to content

Commit b07f17e

Browse files
Merge pull request #35896 from rwestMSFT/rw-1120-fix-508607
Refresh sp_refreshview article (UUF 508607)
2 parents 1a3a30f + 747a729 commit b07f17e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/relational-databases/system-stored-procedures/sp-refreshview-transact-sql.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: sp_refreshview updates the metadata for the specified non-schema-bo
44
author: markingmyname
55
ms.author: maghan
66
ms.reviewer: randolphwest
7-
ms.date: 06/23/2025
7+
ms.date: 11/20/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -46,20 +46,22 @@ The name of the view. *@viewname* is **nvarchar**, with no default. *@viewname*
4646

4747
## Remarks
4848

49-
If a view isn't created with SCHEMABINDING, `sp_refreshview` should be run when changes are made to the objects underlying the view, which affect the definition of the view. Otherwise, the view might produce unexpected results when it's queried.
49+
If a view isn't created with `SCHEMABINDING`, `sp_refreshview` should be run when changes are made to the objects underlying the view, which affects the definition of the view. Otherwise, the view could produce unexpected results when you query it.
5050

5151
## Permissions
5252

53-
Requires ALTER permission on the view and REFERENCES permission on common language runtime (CLR) user-defined types and XML schema collections that are referenced by the view columns.
53+
Requires `ALTER` permission on the view, and `REFERENCES` permission on common language runtime (CLR) user-defined types and XML schema collections that the view columns reference.
5454

5555
## Examples
5656

57+
[!INCLUDE [article-uses-adventureworks](../../includes/article-uses-adventureworks.md)]
58+
5759
### A. Update the metadata of a view
5860

5961
The following example refreshes the metadata for the view `Sales.vIndividualCustomer`.
6062

6163
```sql
62-
USE AdventureWorks2022;
64+
USE AdventureWorks2025;
6365
GO
6466

6567
EXECUTE sp_refreshview N'Sales.vIndividualCustomer';
@@ -70,7 +72,7 @@ EXECUTE sp_refreshview N'Sales.vIndividualCustomer';
7072
Assume that the table `Person.Person` was changed in a way that would affect the definition of any views that are created on it. The following example creates a script that refreshes the metadata for all views that have a dependency on table `Person.Person`.
7173

7274
```sql
73-
USE AdventureWorks2022;
75+
USE AdventureWorks2025;
7476
GO
7577

7678
SELECT DISTINCT 'EXECUTE sp_refreshview ''' + name + ''''
@@ -87,4 +89,3 @@ WHERE so.type = 'V'
8789
- [System stored procedures (Transact-SQL)](system-stored-procedures-transact-sql.md)
8890
- [sys.sql_expression_dependencies (Transact-SQL)](../system-catalog-views/sys-sql-expression-dependencies-transact-sql.md)
8991
- [sp_refreshsqlmodule (Transact-SQL)](sp-refreshsqlmodule-transact-sql.md)
90-

0 commit comments

Comments
 (0)