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
 which index a table is using in t-sql 2000

Author  Topic 

wick2020
Starting Member

1 Post

Posted - 2007-12-20 : 14:22:57
On one of those common interview question lists, there is the question:

How do you know which index a table is using?

The two answers that I've found are:

SELECT * FROM user_constraints
--and
SELECT TableName,IndexName FROM user_constraints

Both of these return the error:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'user_constraints'.

Is this because I'm using the free version of 2000(MSDE)?
If so, what is the right answer for this version?

-Thanks

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-20 : 15:21:26
Do you mean how to find out indexes on a table? Use sp_helpindex if so. User_constraints is not built-in object.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2007-12-21 : 11:24:28
As well as sp_helpindex , you can also view the Execution Plan - to see which ones are actually used at run time

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -