【问题标题】:How to get a list of fields in a unique constraint如何获取唯一约束中的字段列表
【发布时间】:2009-02-18 04:58:17
【问题描述】:

我有一张在一个或多个字段上具有唯一约束的表。给定约束名称,我想查询系统视图以获取属于该约束的字段列表。

SQL Server 2005。

谢谢。

【问题讨论】:

    标签: sql-server sql-server-2005


    【解决方案1】:

    查看information_schema.constraint_column_usage

    select column_name from information_schema.constraint_column_usage
    where constraint_name = 'your constraint'
    

    【讨论】:

      猜你喜欢
      • 2011-02-10
      • 2010-10-11
      • 1970-01-01
      • 1970-01-01
      • 2019-04-24
      • 2011-07-26
      • 2013-01-19
      • 1970-01-01
      • 2018-05-09
      相关资源
      最近更新 更多