如何查看某种表的索引

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 15:16:03
如何查看某种表的索引
x){ީ/}> ϗX[=3&H; QHOIUPsC]JRKw0R pXis[Bqeg楤V{*d'e&gh$&d%dkbpOwM&B s:0ME%)Izzꚞ ~! ~>>P\B|\Q]⯠1 !;/5( nk3D{AopZ~QjbrFJCr~nnb^zpjб@ӊsP-S5m @ i:

如何查看某种表的索引
如何查看某种表的索引

如何查看某种表的索引
SQL code
USE test
GO


-- 查看某个表的索引
SELECT * FROM sys.sysindexes
WHERE id=object_id('RelactionGraph')

-- 查看整个库的索引
SELECT * FROM sys.sysindexes

-- 查看所有库的索引
IF object_id('tempdb..#')IS NOT NULL
DROP TABLE #
SELECT * INTO # FROM sys.sysindexes WHERE 1=2

INSERT INTO #
EXEC sys.sp_MSforeachdb @command1='Select * from ?.sys.sysindexes'

SELECT * FROM #