|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 5:17 PM
Points: 701,
Visits: 207
|
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, January 25, 2012 7:43 AM
Points: 63,
Visits: 109
|
|
Where does this SP need to be created, I created it in Master and it only returns result from the dbo or sys schema's.
 ACN is the world's largest direct seller of telecommunications and essential services. http://helpu.acndirect.com/ ACN Digital Phone Service customers automatically enjoy unlimited calling to 60 landline destinations around the world, including India, Mexico and the UK!
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 5:17 PM
Points: 701,
Visits: 207
|
|
You need to place it in the database you need to get results for. Had to make it that way to be sure to be able to get table names.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: 2 days ago @ 10:55 PM
Points: 1,160,
Visits: 892
|
|
Great article! This came at just the right time for me! I was trying to do exactly this but got stuck but now, thanks to you!, I don't need to battle anymore. I have one question. I am trying to understand exactly what indexes are and what impact they can have on the database and yes, I think I have that but what I don't quite get is the Included Columns. What impact can they have on a table or the database as a whole? I have, with the help of your sp, identified a table of which the indexes looks cosher but one index have nearly all of the table's columns as included columns. Is this right?
Manie Verster Developer Johannesburg South Africa
Life is about choices.... I choose to be happy today
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 5:17 PM
Points: 701,
Visits: 207
|
|
Included columns are available only to cover to query (prevent bookmark lookups), but not for seeks. Included columns can assist in exploiting the fact that clustered indexes append its key as seeks (non-unique indexes; it appends as includes for unique indexes) at the end by limiting columns only needed to prevent bookmark lookups to the leaf level. I have several indexes with one or two seek columns and 3+ include columns (for covering the query) that rely on the clustered index key for 3rd or 4th seek columns. If these 'cover the query' only columns were seeks, it would ruin clustered index exploitation for additional seek columns.
|
|
|
|