我想列出所有约束名称及其各自的列名称。我使用下面提到的代码:
select *
from sys.objects
where parent_object_id = object_id('qw') --this gives me the constraints lists but does not give me columns in which they are applied.
select *
from sys.columns
where object_id = object_id('qw') -- this gives me the column list of the table.
我的问题是我无法加入这两个查询以获取列及其约束。