Identifying Unused Objects in a Database

  • Please try to read article carefully before trying.

    #1. You can use "nolock" hint

    #2. I did exclude where clause from the tests I was doing. Insert all rows to the temporary table and then get the objectid you are looking for. I show it for one object as an example at the beginning of the article. But in reality I never done it on the object by object bases.

    Always all records from syscache table and then make an analysis

  • I did a slight alteration to the way this works in order to better do what I wanted... Rather than doing the insert each time and then relying on the query at the end to determine if it had been in the cache at one point, I insert up front and then have the job delete from the table any references to that object if it's currently in the cache. This way, whatever is in the table at the end of my monitoring period are things that weren't in the cache at some point during the period.

    Granted, it isn't fool-proof going off the cache, but it at least helps narrow things down.

    --Kevin Fairchild

  • Okay, this works for SS2005. What exists to do the same kind of thing in SS2000?

  • I saw this tool that finds Unused Stored Procedures:

  • Sorry to resurrect this old thread, but I"m in the middle of a project to upgrade our sql 2000 dbs to sql 2008. I'd like to also use this as an opportunity to get rid of any procedures that aren't being used.

    For the most part, I like the solution. I'm curious to hear everyone's input though about the frequency he ran the update code. Every 15 minutes? Ouch! Can somoene explain to me why this couldn't just as easily be run every hour or every 3 or 4 hours. If I were to run that code on my dbs every 15 minutes for a month, and have a whole other issue to contend with!:w00t:

  • BobMcC (7/30/2009)


    Sorry to resurrect this old thread, but I"m in the middle of a project to upgrade our sql 2000 dbs to sql 2008. I'd like to also use this as an opportunity to get rid of any procedures that aren't being used.

    For the most part, I like the solution. I'm curious to hear everyone's input though about the frequency he ran the update code. Every 15 minutes? Ouch! Can somoene explain to me why this couldn't just as easily be run every hour or every 3 or 4 hours. If I were to run that code on my dbs every 15 minutes for a month, and have a whole other issue to contend with!:w00t:

    There is no harm to output to stand along table with identity column primary key in another database every 15 minute.

    Even it will be millions of rows identity will always pack the rows and place it at the end of the page. I did it for 2 months and run solution every 2-3 minutes without any issues.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply