Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Get list of tables having index

Author  Topic 

razeena
Yak Posting Veteran

54 Posts

Posted - 2011-08-11 : 05:40:46
Hi,
Is there any sql command to get the list of tables with index
in a particluar database in sql server 2005?

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-08-11 : 07:51:45
select OBJECT_NAME(object_id) as TableName,* from sys.indexes
where type_desc <> 'HEAP'

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

razeena
Yak Posting Veteran

54 Posts

Posted - 2011-08-11 : 08:04:56
Thanks. How to acheive the same in Sql 2000?
quote:
Originally posted by jimf

select OBJECT_NAME(object_id) as TableName,* from sys.indexes
where type_desc <> 'HEAP'

Jim

Everyday I learn something that somebody else already knew

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-11 : 08:19:05
look at sysindexes view

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -