How to get
the list of all existing indexes of a table:
There is a system stored procedure “sp_helpindex”, which can be used to get the list of all existing indexes by supplying table name to it. We can use this stored procedure as -
Code |
Let's see it by practical. I am creating a table with 3 indexes on it. I am creating 2 indexes while creating my table tblTestAKumar and later adding 1 index using CREATE INDEX command. By default CREATE INDEX command is going to add a Non-Clustered index to my table.
SQL |
We will add a one more index on LastUpdatedOn column using below command as-
Code |
Now we will execute system stored procedure ”sp_helpindex” by supplying our table as –
Code |
This gives us following result:



Anil KumarPosted Jun 5, 2012, 8:21 AM EDT
Thanks
Lajapathy ArunPosted Jun 5, 2012, 1:24 AM EDT
Good one