Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query to get tables having indexing in a particular database

Tags:

sql

sql-server

Can anyone provide me the query in sql server to extract the tables that have been done indexing, for a particular database....

like image 226
Srivastava Avatar asked Dec 14 '25 21:12

Srivastava


1 Answers

Your question is somewhat unclear. This will return all tables with at least one index.

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

Or for SQL Server 2000

select DISTINCT OBJECT_NAME(id)   
from sysindexes 
where indid<>0
like image 54
Martin Smith Avatar answered Dec 16 '25 11:12

Martin Smith