如何通过索引名和约束名得到约束的字段名?

dgcoo 2003-12-18 10:20:06
如何通过索引名和约束名得到约束包含的字段名?
...全文
90 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Rotaxe 2003-12-18
  • 打赏
  • 举报
回复
select name from syscolumns c where exists (select * from syscomments m where c.colid=m.colid and id in(select id from sysobjects o where type='c' and c.id=o.parent_obj and name='约束名'))
Rotaxe 2003-12-18
  • 打赏
  • 举报
回复
select name from syscolumns c where exists (select colid from
sysindexkeys k WHERE k.colid=c.colid and k.id=c.id and exists (select id from sysindexes i where i.id=k.id and i.indid=k.indid and name='索引名'))
dgcoo 2003-12-18
  • 打赏
  • 举报
回复
多谢仁兄

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧