查询sql 索引
SELECT indexname = a.name , tablename = c. name , indexcolumns = d .name , a .indid
FROM sysindexes a JOIN sysindexkeys b ON a .id = b .id AND a .indid = b.indid
JOIN sysobjects c ON b .id = c .id
JOIN syscolumns d ON b .id = d .id AND b .colid = d .colid
WHERE a .indid NOT IN ( 0 , 255 )
-- and c.xtype='U' and c.status>0 -- 查所有用户表
AND c .name = 'xxxx' --查指定表
ORDER BY c. name ,
a.name ,
d.name
FROM sysindexes a JOIN sysindexkeys b ON a .id = b .id AND a .indid = b.indid
JOIN sysobjects c ON b .id = c .id
JOIN syscolumns d ON b .id = d .id AND b .colid = d .colid
WHERE a .indid NOT IN ( 0 , 255 )
-- and c.xtype='U' and c.status>0 -- 查所有用户表
AND c .name = 'xxxx' --查指定表
ORDER BY c. name ,
a.name ,
d.name
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
【SQL进阶】CASE语句的使用
金大鑫要堅持
2024-05-30 14:29:54
blog-auto-publishing-tools博客自动发布工具
https://github.com/ddean2009/blog-auto-publishing-tools
hiningrise
2024-05-30 14:28:04
微服务新体验之Aspire初体验
hiningrise
2024-05-30 14:28:04
第七节:RabbitMq延迟队列实操(死信交换机+TTL)和死信插件的使用
一. 二. 三. ! 作 者 : Yaopengfei(姚鵬飛) 博客地址 : http://www.cnblogs.com
Yaopengfei
2024-05-30 14:24:33
flask 配合 sqlite3 维护数据库的数据方法
張博的博客
2024-05-30 14:22:53
C#去除时间格式化之后中间的T字母
興想事成
2024-05-30 14:22:43
国外lead,联盟常用名词解释
weiooo
2024-05-30 14:22:03
python3.x中ORM框架SQLObject使用SQLite数据库随笔
銘久
2024-05-30 14:21:53
npm error Cannot read properties of null (reading 'isDescendantOf')
阿 軍
2024-05-30 14:18:13
error in ./node_modules/@intlify/core-base/dist/core-base.cjs
ERROR Failed to compile with 1 error
阿 軍
2024-05-30 14:18:13
optional install error: Error: Unsupported URL Type: npm:vue-loader@^16.1.0
阿 軍
2024-05-30 14:18:13
request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired
阿 軍
2024-05-30 14:18:13
nvidia-smi版本驱动不匹配,以及 cuda不可用两个问题处理
馬昌偉
2024-05-30 14:16:52