June 2, 2010 at 7:45 pm
i want to display the list of indexes of all the tables in db?
plz any one help me?
thankyou
June 2, 2010 at 8:04 pm
Check out sys.indexes and sys.objects in Books Online. However, if you are on a developed system, you will probably be overwhelmed by a list of all indexes on all tables in a database. If you want to look at information about indexes on a particular table you can also use sp_helpindex.
June 2, 2010 at 8:10 pm
SELECT [TableName] = st.name,
[IndexName] = si.name
FROM sys.tables st
JOIN sys.indexes si
ON si.object_id = st.object_id
WHERE st.is_ms_shipped = 0
ORDER BY st.name, si.name
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 2, 2010 at 9:25 pm
thankyou
can you plz tell same using coursors?
June 2, 2010 at 9:29 pm
vijay82 (6/2/2010)
thankyoucan you plz tell same using coursors?
Sorry, I don't do c.u.r.s.o.r.s.
(See??? I can't even type it!) :w00t:
..... what's wrong with the query? Why do you feel a cursor is necessary?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 2, 2010 at 11:09 pm
~Edit: Wrong code at wrong place :sick:
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply