Mike Eghtebas
asked on
How to view index content?
I have created PK_Student_StudId (clustered).
I suppose I could view the content of index table (index data) using
Select StudID, StudName, Class From Student Order By StudID;
But, is there a way I can access and view the actual table my PK_Student_StudId index has created?
Or, is it in binary form and cannot be viewed directly? If so, how can be transformed and viewed?
At least its number of rows and its column names to be printed/ investigated.
Thank you.
I suppose I could view the content of index table (index data) using
Select StudID, StudName, Class From Student Order By StudID;
But, is there a way I can access and view the actual table my PK_Student_StudId index has created?
Or, is it in binary form and cannot be viewed directly? If so, how can be transformed and viewed?
At least its number of rows and its column names to be printed/ investigated.
Thank you.
Another option for viewing index information for your table.
http://technet.microsoft.c om/en-us/l ibrary/ms1 89603(v=sq l.105).asp x
http://technet.microsoft.c
ASKER
I tried:
EXEC sp_helpindex 'Student.StudID'
Error: Msg 15009, Level 16, State 1, Procedure sp_helpindex, Line 37
The object 'Student.StudID' does not exist in database 'DBstudy' or is invalid for this operation.
EXEC sp_helpindex 'PK_Student_StudId'
The object 'PK_Student_StudId' does not have any indexes, or you do not have permissions.
EXEC sp_helpindex 'Student'
Error: Msg 15009, Level 16, State 1, Procedure sp_helpindex, Line 37
The object 'StudId' does not exist in database 'DBstudy' or is invalid for this operation.
I will read the links next.
Thank you for the comments.
Mike
EXEC sp_helpindex 'Student.StudID'
Error: Msg 15009, Level 16, State 1, Procedure sp_helpindex, Line 37
The object 'Student.StudID' does not exist in database 'DBstudy' or is invalid for this operation.
EXEC sp_helpindex 'PK_Student_StudId'
The object 'PK_Student_StudId' does not have any indexes, or you do not have permissions.
EXEC sp_helpindex 'Student'
Error: Msg 15009, Level 16, State 1, Procedure sp_helpindex, Line 37
The object 'StudId' does not exist in database 'DBstudy' or is invalid for this operation.
I will read the links next.
Thank you for the comments.
Mike
ASKER
1. From link, http://technet.microsoft.com/en-us/library/ms188280(v=sql.105).aspx , for example, I do I use:
sys.stats_columns
from c prompt ot T-sql? What is the syntax?
sys.stats_columns
from c prompt ot T-sql? What is the syntax?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I also noticed the following works without ' either side:
EXEC sp_helpindex Student
EXEC sp_helpindex Student
http://technet.microsoft.c
Running an sp_helpindex may also give you the index info that you need.
EXEC sp_helpindex 'Student.StudID'