sys.key_constraints (Transact-SQL)sys.key_constraints (Transact-SQL)

适用对象: yesSQL ServeryesAzure SQL 数据库yesAzure SQL 数据仓库yes并行数据仓库APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure SQL Data Warehouse yesParallel Data Warehouse

每个作为主键或唯一约束的对象对应一行。Contains a row for each object that is a primary key or unique constraint. 包括sys.objects.type PK 和 UQ。Includes sys.objects.type PK and UQ.

列名Column name 数据类型Data type 描述Description
<从 sys.objects 继承的列 ><Columns inherited from sys.objects> 此视图所继承的列的列表,请参阅sys.objects (TRANSACT-SQL)For a list of columns that this view inherits, see sys.objects (Transact-SQL).
unique_index_idunique_index_id intint 为强制该约束而创建的父对象中相应唯一索引的 ID。ID of the corresponding unique index in the parent object that was created to enforce this constraint.
is_system_namedis_system_named bitbit 1 = 名称由系统生成。1 = Name was generated by system.

0 = 名称由用户提供。0 = Name was supplied by the user.


目录视图中仅显示用户拥有的安全对象的元数据,或用户对其拥有某些权限的安全对象的元数据。The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. 有关详细信息,请参阅 Metadata Visibility ConfigurationFor more information, see Metadata Visibility Configuration.

请参阅See Also

对象目录视图 (Transact-SQL) Object Catalog Views (Transact-SQL)
目录视图 (Transact-SQL) Catalog Views (Transact-SQL)
查询 SQL Server 系统目录常见问题解答Querying the SQL Server System Catalog FAQ