removing unused stored procedures SQL 2000 | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

removing unused stored procedures SQL 2000

gurus forgive me if this has been discussed before or if it is a basic fundamental… but… is there a quick/easy way in MSSQL Server 2000 to remove stored procedures that have accumilated during the development cycle but are no longer used by my application. stored procedures are called by my asp application. so i am thinking SQL Server will have no idea of what my asp application does and doesn’t need any more. please tell me i am wrong and that the guys working for bill gates forsaw that booger heads like me will be using their products and incorporated a magic button that with one click will remove all the stored procedures that i created during development, that are no longer being used. richgran "…as a thief in the night…"
Well, the clown in me would say: Yes, there is an easy way. Just drop the procedure(s), and see if anything breaks. [<img src=’/community/emoticons/emotion-4.gif’ alt=’:p‘ />]<br /><br />Unfortunately there is no easy way. Probably the easiest one would be to start a trace and let it run over some period of time and then analyse it which objects have been referenced and which have not.<br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />Heute schon gebloggt?<a target="_blank" href=http://www.insidesql.de/blogs>http://www.insidesql.de/blogs</a><br />
If you meant to know unused objects, see if this helps http://www.pinpub.com/ME2/Audiences…50&tier=4&id=CE9E01AE99334E1CBDC32C150AE6BE08 Madhivanan Failing to plan is Planning to fail
Hi,<br />theirs a discussion about unused object (indexs) in our SSP too , see if it helps :<br /><br /<a target="_blank" href=http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=9613>http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=9613</a><br /><br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br />
&gt;&gt;theirs a discussion about unused object (indexs) in our SSP too , see if it helps :<br /><br />I think the questioner wants to know unused sps and not indices [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br /><b>is there a quick/easy way in MSSQL Server 2000 to remove stored procedures that have accumilated during the development cycle but are no longer used by my application. </b><br /><br /><br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
After the fact, there is never a quick and easy way. You’ve got to keep track of these things as part of the design process. IOW: clean up after yourself.
Hi,<br /><br />* think the questioner wants to know unused sps and not indices <br />thats very true that questioner asked about sps but as the logic used to identify unused index, the same logic will be used to identify sps too …. isn’t it ?!<br /><br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br />
Not really. <br />When trying to identify unused sp’s you can for example use a workaround like that:<br />Add another auditing table to the db.<br />Script all sp’s into one script. <br />Add code to the sp’s that they do a simple INSERT INTO the auditing table. One column would be @@PROCID (or the name of the proc if you prefer a cleaner way) and another one GETDATE().<br />Reapply the script to the db<br /><br />Now each time an sp is called it INSERTs the information to the audit table and you can analyse that table after a while and remove procedures you don’t find in there.<br /><br />Try that with indexes. [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />Heute schon gebloggt?<a target="_blank" href=http://www.insidesql.de/blogs>http://www.insidesql.de/blogs</a><br />
Can’t we get sps name in profiler trace ! suppose profiler trace for a weekly or monthly trace would give us a list of sps and the others are not used as oftenly ! with this can’t we figure out something !?<br /><br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br />
Well, not to be rude or anything, but the original poster’s question was for SPs that have accumilated during the development cycle but are no longer used by my application. Why all the technical solutions? My advice "clean up after yourself" was the appropriate answer.
Adriaan, yes, while your answer is the correct one, it doesn’t help the OP here, since he hasn’t done so. Hopefully this will be a lesson for the future. [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br />Hemantgiri, it’s more difficult to analyse a trace correctly than simply reading a single column.<br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />Heute schon gebloggt?<a target="_blank" href=http://www.insidesql.de/blogs>http://www.insidesql.de/blogs</a><br />
Guys! guys…. You#%92ve been having a good discussion behind my back without me! Just kidding! I failed to subscribed to this thread and was waiting for an email… just visited the post now and would like to thank you gurus for interesting input. Excellent!
Thanks for your help ps. As a clown myself , the first suggestion appeals….
"…as a thief in the night…"
Heya,
I believe the program Apex SQL Clean can do the job for you. Ben ‘I reject your reality and substitute my own’ – Adam Savage
BTW why do you want to clear off the stored procedures that are not used, you can take help ofhttp://www.pinpub.com/ME2/Audiences…50&tier=4&id=CE9E01AE99334E1CBDC32C150AE6BE08 to get the information. But I suggest leave them on the database and do not give any EXEC permissions to the logins in order to tighten the security. Satya SKJ
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>