Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to SQL Server Management Studio "View Dependencies" [closed]

I have known for awhile that the "View Dependencies" feature in SQL Server Management Studio is borderline useless as it hardly ever returns all dependencies, however, is there a better alternative? This is a pretty powerful feature for obvious reasons, but if you cannot rely on the results (as is the case with Microsoft), you have to do all the work by hand anyhow, just to be safe.

It seems like this would be pretty easy to implement, are there any tools out there that handle this effectively?

As a side note, does anyone know what is wrong with "View Dependencies"? Is there a specific class of dependencies that it has trouble identifying?

like image 297
Michael Kingsmill Avatar asked May 14 '12 15:05

Michael Kingsmill


3 Answers

Late one but hopefully useful since recommended tool is free …

I’m using a similar tool to the one David recommended – ApexSQL Search. They claim to have their own dependency tracking mechanism that works for everything but dynamic SQL.

I haven’t tested it in detail to confirm this though…

Disclaimer: I’m not affiliated with this company but I do use their tools frequently.

like image 110
Terence Eccleston Avatar answered Sep 28 '22 06:09

Terence Eccleston


Red Gate has tool called SQL Dependency Tracker that works pretty well.

You can also write a query against the sys.sql_dependencies view which would give some basic info. Similar to this:

SELECT o.name, o.type_desc, p.name, p.type_desc
FROM sys.sql_dependencies d
INNER JOIN sys.objects o
    ON d.object_id = o.object_id
INNER JOIN sys.objects p
    ON d.referenced_major_id = p.object_id

Here is an article about finding dependencies:

Finding dependencies in SQL Server 2005

like image 36
Taryn Avatar answered Sep 28 '22 07:09

Taryn


You could try using SQL Search, which does a textual search of the object names and the textual definitions. The advantage is that it will also pick up dynamic SQL references, and the drawback is that it may pick up false positives as it's not searching based on a true dependency tree.

http://www.red-gate.com/products/sql-development/sql-search/

Another advantage is that it's currently free.

like image 28
David Atkinson Avatar answered Sep 28 '22 07:09

David Atkinson