sys.database_credentials (Transact-sql) sys.database_credentials (Transact-SQL)

适用于:Applies to: 是SQL Server 2016 (13.x)SQL Server 2016 (13.x)yesSQL Server 2016 (13.x)SQL Server 2016 (13.x) 及更高版本 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics适用于:Applies to: 是SQL Server 2016 (13.x)SQL Server 2016 (13.x)yesSQL Server 2016 (13.x)SQL Server 2016 (13.x) and later 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics

为数据库中的每个数据库作用域凭据返回一行。Returns one row for each database scoped credential in the database.

重要

后续版本的 Microsoft SQL Server 将删除该功能。This feature will be removed in a future version of Microsoft SQL Server. 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。Avoid using this feature in new development work, and plan to modify applications that currently use this feature. 改用 sys.database_scoped_credentialsUse sys.database_scoped_credentials instead.

列名称Column name 数据类型Data type 说明Description
credential_idcredential_id intint 数据库作用域凭据的 ID。ID of the database scoped credential. 在数据库中是唯一的。Is unique in the database.
namename sysnamesysname 数据库作用域凭据的名称。Name of the database scoped credential. 在数据库中是唯一的。Is unique in the database.
credential_identitycredential_identity nvarchar(4000)nvarchar(4000) 要使用的标识的名称。Name of the identity to use. 这通常是一个 Windows 用户。This will generally be a Windows user. 它不必是唯一的。It does not have to be unique.
create_datecreate_date datetimedatetime 创建数据库作用域凭据的时间。Time at which the database scoped credential was created.
modify_datemodify_date datetimedatetime 上次修改数据库作用域凭据的时间。Time at which the database scoped credential was last modified.
target_typetarget_type nvarchar (100)nvarchar(100) 数据库作用域凭据的类型。Type of database scoped credential. 对于数据库范围的凭据,返回 NULL。Returns NULL for database scoped credentials.
target_idtarget_id intint 将数据库范围凭据映射到的对象的 ID。ID of the object that the database scoped credential is mapped to. 对于数据库范围的凭据,返回0Returns 0 for database scoped credentials

权限Permissions

需要对数据库拥有 CONTROL 权限。Requires CONTROL permission on the database.

另请参阅See Also

凭据(数据库引擎) Credentials (Database Engine)
CREATE DATABASE SCOPED CREDENTIAL (Transact-SQL) CREATE DATABASE SCOPED CREDENTIAL (Transact-SQL)
ALTER DATABASE SCOPED CREDENTIAL (Transact-SQL) ALTER DATABASE SCOPED CREDENTIAL (Transact-SQL)
DROP DATABASE SCOPED CREDENTIAL (Transact-SQL) DROP DATABASE SCOPED CREDENTIAL (Transact-SQL)
CREATE CREDENTIAL (Transact-SQL) CREATE CREDENTIAL (Transact-SQL)
sys.credentials (Transact-SQL)sys.credentials (Transact-SQL)