Skip to content

Commit 642dc23

Browse files
20230616 1139 acrolinx
1 parent 6a95497 commit 642dc23

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎docs/relational-databases/system-catalog-views/sys-database-permissions-transact-sql.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "sys.database_permissions (Transact-SQL)"
3-
description: sys.database_permissions (Transact-SQL)
3+
description: sys.database_permissions returns a row for every permission or column-exception permission in the database.
44
author: VanMSFT
55
ms.author: vanto
66
ms.date: 06/16/2023

‎docs/relational-databases/views/rename-views.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Rename Views"
3-
description: "Rename Views"
3+
description: "Tutorial on how to rename a view."
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
66
ms.date: 06/16/2023
@@ -24,7 +24,7 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||>=sql-server-2016||>=sql-ser
2424

2525
1. Obtain a list of all dependencies on the view. Any objects, scripts, or applications that reference the view must be modified to reflect the new name of the view. For more information, see [Get Information About a View](../../relational-databases/views/get-information-about-a-view.md).
2626
1. We recommend that you drop the view and recreate it with a new name instead of renaming the view. By recreating the view, you update the dependency information for the objects that are referenced in the view.
27-
1. Dropping and re-creating a view will remove any granular SQL permissions that had been assigned to the view. If any permissions had been assigned specifically, you will need to GRANT the permissions to the view again. To retrieve the granular permissions granted on an object before it is dropped, see the examples in [sys.database_permissions (Transact-SQL)](../system-catalog-views/sys-database-permissions-transact-sql.md). To grant permissions, see [Grant a Permission to a Principal](../security/authentication-access/grant-a-permission-to-a-principal.md).
27+
1. Dropping and re-creating a view will remove any granular SQL permissions assigned to the view. If any granular SQL permissions are assigned to the view, you will need to GRANT the permissions to the view again after it's re-created. To retrieve the granular permissions granted on an object before it's dropped, see the examples in [sys.database_permissions (Transact-SQL)](../system-catalog-views/sys-database-permissions-transact-sql.md). To grant permissions, see [Grant a Permission to a Principal](../security/authentication-access/grant-a-permission-to-a-principal.md).
2828

2929

3030
## <a id="Permissions"></a> Permissions
@@ -43,9 +43,9 @@ monikerRange: ">=aps-pdw-2016||=azuresqldb-current||>=sql-server-2016||>=sql-ser
4343

4444
## <a id="TsqlProcedure"></a> Use Transact-SQL
4545

46-
While you can use `sp_rename` to change the name of the view, we recommend that you delete the existing view and then re-create it with the new name.
46+
While you can use `sp_rename` to change the name of the view, we recommend that you delete the existing view, and then re-create it with the new name.
4747

48-
This is because renaming a stored procedure, function, view, or trigger doesn't change the name of the corresponding object in the definition column of the [sys.sql_modules](../system-catalog-views/sys-sql-modules-transact-sql.md) catalog view, leading to future confusion. Therefore, we recommend that `sp_rename` not be used to rename these object types. Instead, drop and re-create the object with its new name.
48+
When you rename a stored procedure, function, view, or trigger with `sp_rename`, the name of the corresponding object doesn't change in the definition column of the [sys.sql_modules](../system-catalog-views/sys-sql-modules-transact-sql.md) catalog view. This can lead to future confusion. Therefore, we don't recommend using `sp_rename` to rename objects. Instead, drop and re-create the object with its new name.
4949

5050
For example:
5151

@@ -64,4 +64,4 @@ This is because renaming a stored procedure, function, view, or trigger doesn't
6464
## <a id="FollowUp"></a> Follow up: after renaming a view
6565

6666
1. Ensure that all objects, scripts, and applications that reference the view's old name now use the new name.
67-
1. Dropping and re-creating a view will remove any granular SQL permissions that had been assigned to the view. If any permissions had been assigned specifically, you will need to GRANT the permissions to the view again. To retrieve the granular permissions granted on an object before it is dropped, see the examples in [sys.database_permissions (Transact-SQL)](../system-catalog-views/sys-database-permissions-transact-sql.md). To grant permissions, see [Grant a Permission to a Principal](../security/authentication-access/grant-a-permission-to-a-principal.md).
67+
1. Dropping and re-creating a view will remove any granular SQL permissions assigned to the view. If any granular SQL permissions are assigned to the view, you'll need to GRANT the permissions to the view again when it's re-created. To retrieve the granular permissions granted on an object before it's dropped, see the examples in [sys.database_permissions (Transact-SQL)](../system-catalog-views/sys-database-permissions-transact-sql.md). To grant permissions, see [Grant a Permission to a Principal](../security/authentication-access/grant-a-permission-to-a-principal.md).

0 commit comments

Comments
 (0)