Groups | Blog | Home
all groups > sql server (alternate) > july 2004 >

sql server (alternate) : Dependencies in SQL Server - help


khurram_iftikhar NO[at]SPAM yahoo.com
7/21/2004 11:34:57 AM
I am in the process of cleaning up an existing database application.
I know for sure that there are many unused tables and procedures
contained in this application. I wanted to use the sysdepends table
in SQL Server to find out what tables are used, but as many of you
already know, the dependency information contained in this table can
be inaccurate.

Finally, the question - Is there another tool out there that has the
capability of finding the dependencies correclty ?

Thanks in advance.

Simon Hayes
7/21/2004 8:56:54 PM

[quoted text, click to view]

The short answer is no - if the dependency information is not stored
anywhere, then no tool can find it. There are some tools which parse the
text of procedures, views etc. and identify dependencies that way. However,
if you have SQL code which is embedded in a middle tier or client
application, or if you use dynamic SQL heavily, then that isn't completely
reliable either.

The closest you can get is probably to look at the information in both
sysdepends and syscomments, as well as searching through any other source
code for references to objects which you suspect are no longer used. After
that, you start dropping objects, and see if someone complains...

In the future, you may want to review how you maintain your code, as you can
address dependency issues using source control and automated build
processes - Erland's toolset might give you some useful ideas:

http://www.abaris.se/abaperls/

Simon

AddThis Social Bookmark Button