查找索引所屬表

有時需要根據索引名稱,找到該索引所屬的表。

select a.name as tabname
,h.name as idname
from sys.objects as a 
right join sys.indexes as h on a.object_id=h.object_id
where a.type<>'s' AND (h.name LIKE '%Width%' OR h.name LIKE '%Height%' )

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章