Skip to content

Commit d54a077

Browse files
authored
Merge pull request #33965 from rwestMSFT/rw-0430-catalog-view-warning
[SCOPED] Fix wording on system catalog view warning
2 parents 811e4ac + 44a864b commit d54a077

12 files changed

+32
-32
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
author: rwestMSFT
33
ms.author: randolphwest
4-
ms.date: 01/29/2024
4+
ms.date: 04/30/2025
55
ms.service: sql
66
ms.topic: include
77
---
8-
Beginning with SQL Server 2005, the behavior of schemas changed. As a result, code that assumes that schemas are equivalent to database users may no longer return correct results. Old catalog views, including sysobjects, should not be used in a database in which any of the following DDL statements have ever been used: CREATE SCHEMA, ALTER SCHEMA, DROP SCHEMA, CREATE USER, ALTER USER, DROP USER, CREATE ROLE, ALTER ROLE, DROP ROLE, CREATE APPROLE, ALTER APPROLE, DROP APPROLE, ALTER AUTHORIZATION. In such databases you must instead use the new catalog views. The new catalog views take into account the separation of principals and schemas that was introduced in SQL Server 2005. For more information about catalog views, see [Catalog Views (Transact-SQL)](../relational-databases/system-catalog-views/catalog-views-transact-sql.md).
9-
8+
Schemas aren't equivalent to database users. Use [System catalog views](../relational-databases/system-catalog-views/catalog-views-transact-sql.md) to identify any differences between database users and schemas.

docs/t-sql/statements/alter-application-role-transact-sql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dev_langs:
2121

2222
# ALTER APPLICATION ROLE (Transact-SQL)
2323

24-
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
24+
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2525

2626
Changes the name, password, or default schema of an application role.
2727

@@ -62,10 +62,10 @@ If the new application role name already exists in the database, the statement w
6262
> Password expiration policy is not applied to application role passwords. For this reason, take extra care in selecting strong passwords. Applications that invoke application roles must store their passwords.
6363
6464
Application roles are visible in the sys.database_principals catalog view.
65-
66-
> [!CAUTION]
67-
> In [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)]the behavior of schemas changed from the behavior in earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Code that assumes that schemas are equivalent to database users may not return correct results. Old catalog views, including sysobjects, should not be used in a database in which any of the following DDL statements has ever been used: CREATE SCHEMA, ALTER SCHEMA, DROP SCHEMA, CREATE USER, ALTER USER, DROP USER, CREATE ROLE, ALTER ROLE, DROP ROLE, CREATE APPROLE, ALTER APPROLE, DROP APPROLE, ALTER AUTHORIZATION. In a database in which any of these statements has ever been used, you must use the new catalog views. The new catalog views take into account the separation of principals and schemas that is introduced in [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)]. For more information about catalog views, see [Catalog Views (Transact-SQL)](../../relational-databases/system-catalog-views/catalog-views-transact-sql.md).
68-
65+
66+
> [!NOTE]
67+
> [!INCLUDE [sscautionuserschema-md](../../includes/sscautionuserschema-md.md)]
68+
6969
## Permissions
7070
Requires ALTER ANY APPLICATION ROLE permission on the database. To change the default schema, the user also needs ALTER permission on the application role. An application role can alter its own default schema, but not its name or password.
7171

docs/t-sql/statements/alter-authorization-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ The SCHEMA OWNER option is only valid when you are transferring ownership of a s
171171

172172
If the target entity is not a database and the entity is being transferred to a new owner, all permissions on the target will be dropped.
173173

174-
> [!CAUTION]
175-
> In [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)], the behavior of schemas changed from the behavior in earlier versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Code that assumes that schemas are equivalent to database users may not return correct results. Old catalog views, including sysobjects, should not be used in a database in which any of the following DDL statements has ever been used: CREATE SCHEMA, ALTER SCHEMA, DROP SCHEMA, CREATE USER, ALTER USER, DROP USER, CREATE ROLE, ALTER ROLE, DROP ROLE, CREATE APPROLE, ALTER APPROLE, DROP APPROLE, ALTER AUTHORIZATION. In a database in which any of these statements has ever been used, you must use the new catalog views. The new catalog views take into account the separation of principals and schemas that was introduced in [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)]. For more information about catalog views, see [Catalog Views (Transact-SQL)](../../relational-databases/system-catalog-views/catalog-views-transact-sql.md).
174+
> [!NOTE]
175+
> [!INCLUDE [sscautionuserschema-md](../../includes/sscautionuserschema-md.md)]
176176
177177
Also, note the following:
178178

docs/t-sql/statements/alter-schema-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ ALTER SCHEMA schema_name
7878

7979
ALTER SCHEMA uses a schema level lock.
8080

81-
> [!CAUTION]
82-
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
81+
> [!NOTE]
82+
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
8383
8484
## Permissions
8585
To transfer a securable from another schema, the current user must have CONTROL permission on the securable (not schema) and ALTER permission on the target schema.

docs/t-sql/statements/alter-user-transact-sql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ NAME = new_user_name
169169

170170
The name of a user mapped to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login, a certificate, or an asymmetric key can't contain the backslash character (`\`).
171171

172-
> [!CAUTION]
172+
> [!NOTE]
173173
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
174174
175175
## Security
@@ -422,7 +422,7 @@ Setting the default schema to `NULL` removes a default schema from a user create
422422

423423
The name of a user mapped to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login, a certificate, or an asymmetric key can't contain the backslash character (`\`).
424424

425-
> [!CAUTION]
425+
> [!NOTE]
426426
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
427427
428428
### Fabric SQL database
@@ -677,7 +677,7 @@ ALTER USER user_name
677677

678678
The name of a user mapped to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login, a certificate, or an asymmetric key can't contain the backslash character (`\`).
679679

680-
> [!CAUTION]
680+
> [!NOTE]
681681
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
682682
683683
### Remarks for Windows users in SQL on-premises migrated to Azure SQL Managed Instance
@@ -915,7 +915,7 @@ ALTER USER user_name
915915

916916
The name of a user mapped to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login, a certificate, or an asymmetric key can't contain the backslash character (`\`).
917917

918-
> [!CAUTION]
918+
> [!NOTE]
919919
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
920920
921921
## Security
@@ -1054,7 +1054,7 @@ ALTER USER user_name
10541054

10551055
The name of a user mapped to a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] login, a certificate, or an asymmetric key can't contain the backslash character (`\`).
10561056

1057-
> [!CAUTION]
1057+
> [!NOTE]
10581058
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
10591059
10601060
## Security

docs/t-sql/statements/create-application-role-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ CREATE APPLICATION ROLE application_role_name
5555

5656
For information about how to use application roles, see [Application Roles](../../relational-databases/security/authentication-access/application-roles.md).
5757

58-
> [!CAUTION]
59-
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
58+
> [!NOTE]
59+
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
6060
6161
## Permissions
6262
Requires ALTER ANY APPLICATION ROLE permission on the database.

docs/t-sql/statements/create-role-transact-sql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ CREATE ROLE role_name [ AUTHORIZATION owner_name ]
5353
Database roles are visible in the sys.database_role_members and sys.database_principals catalog views.
5454

5555
For information about designing a permissions system, see [Getting Started with Database Engine Permissions](../../relational-databases/security/authentication-access/getting-started-with-database-engine-permissions.md).
56-
57-
> [!CAUTION]
58-
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
56+
57+
> [!NOTE]
58+
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
5959
6060
## Permissions
6161
Requires **CREATE ROLE** permission on the database or membership in the **db_securityadmin** fixed database role. When you use the **AUTHORIZATION** option, the following permissions are also required:

docs/t-sql/statements/create-schema-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ CREATE SCHEMA schema_name [ AUTHORIZATION owner_name ] [;]
9898

9999
The new schema is owned by one of the following database-level principals: database user, database role, or application role. Objects created within a schema are owned by the owner of the schema, and have a NULL **principal_id** in **sys.objects**. Ownership of schema-contained objects can be transferred to any database-level principal, but the schema owner always retains CONTROL permission on objects within the schema.
100100

101-
> [!CAUTION]
102-
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
101+
> [!NOTE]
102+
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
103103
104104
**Implicit Schema and User Creation**
105105

docs/t-sql/statements/drop-application-role-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ DROP APPLICATION ROLE rolename
3939
## Remarks
4040
If the application role owns any securables it cannot be dropped. Before dropping an application role that owns securables, you must first transfer ownership of the securables, or drop them.
4141

42-
> [!CAUTION]
43-
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
42+
> [!NOTE]
43+
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
4444
4545
## Permissions
4646
Requires ALTER ANY APPLICATION ROLE permission on the database.

docs/t-sql/statements/drop-role-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ DROP ROLE role_name
6262

6363
Information about role membership can be viewed in the sys.database_role_members catalog view.
6464

65-
> [!CAUTION]
66-
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
65+
> [!NOTE]
66+
> [!INCLUDE[ssCautionUserSchema](../../includes/sscautionuserschema-md.md)]
6767
6868
To remove a server role, use [DROP SERVER ROLE (Transact-SQL)](../../t-sql/statements/drop-server-role-transact-sql.md).
6969

0 commit comments

Comments
 (0)