gpt4 book ai didi

sql - 查询以获取在特定数据库中具有索引的表

转载 作者:行者123 更新时间:2023-12-04 15:59:48 25 4
gpt4 key购买 nike

任何人都可以在 sql server 中为我提供查询以提取已为特定数据库建立索引的表....

最佳答案

你的问题有点不清楚。这将返回具有至少一个索引的所有表。

select DISTINCT OBJECT_NAME(object_id)  
from sys.indexes
where type<>0

或者对于 SQL Server 2000

select DISTINCT OBJECT_NAME(id)   
from sysindexes
where indid<>0

关于sql - 查询以获取在特定数据库中具有索引的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4345956/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com