Geeks With Blogs

News For most companies, development and operation teams play a game of volleyball passing blame on each other when service/product has issues. Lack of communication and understanding between the two, causes costly and timely problems for every company. DevOps is not a title, nor is a position. DevOps is culture represented by a white flag waved from both directions. Cooperation and Communication are at the heart of DevOps. It tears down the wall and pride of these two very valuable entities inside a company and unleashes the power of teamwork towards a common goal!
Erald Gjoni
Below is a quick query that identifies information about Indexes in a particular DB.

SELECT
     TableName = t.name,
     IndexName = ind.name,
     IndexId = ind.index_id,
     ColumnId = ic.index_column_id,
     ColumnName = col.name,
     ind.*,
     ic.*,
     col.*
FROM
     sys.indexes ind
INNER JOIN
     sys.index_columns ic ON  ind.object_id = ic.object_id and ind.index_id = ic.index_id
INNER JOIN
     sys.columns col ON ic.object_id = col.object_id and ic.column_id = col.column_id
INNER JOIN
     sys.tables t ON ind.object_id = t.object_id
WHERE
     ind.is_primary_key = 0
     AND ind.is_unique = 0
     AND ind.is_unique_constraint = 0
     AND t.is_ms_shipped = 0
ORDER BY
     t.name, ind.name, ind.index_id, ic.index_column_id
Posted on Friday, June 6, 2014 3:25 PM devops , sql , Data , index | Back to top


Comments on this post: DB Indexes

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Erald Gjoni | Powered by: GeeksWithBlogs.net