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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Indexes on what tables query?

Author  Topic 

Gopher
Yak Posting Veteran

83 Posts

Posted - 2007-01-23 : 06:55:57
Hi All

Does anyone know of a query I can run which will tell me what indexes are on what tables, as I have to do a comparason with another DB? I was hopin gI could use the sysindexes table?

Thanks in advance!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-23 : 07:10:41
Did you get an error when you tried?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Gopher
Yak Posting Veteran

83 Posts

Posted - 2007-01-23 : 07:13:44
no, but I am not sure how to connect the two at the moment!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-23 : 07:17:51
Try this
select		s1.*,
'<->' as ' ',
s2.*
from db1.dbo.sysindexes as s1
full join db2.dbo.sysindexes as s2 on s2.name = s1.name


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-23 : 07:20:06
You can also make use of sp_helpindex.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-24 : 12:56:31
Red Gate's database compare tools might help you too.

Kristen
Go to Top of Page
   

- Advertisement -