SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Fastest way to find DB object dependencies


Fastest way to find DB object dependencies

Author
Message
ksatpute123
ksatpute123
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2181 Visits: 386
Comments posted to this topic are about the item Fastest way to find DB object dependencies
janis.l.murphy
janis.l.murphy
SSC-Enthusiastic
SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)

Group: General Forum Members
Points: 121 Visits: 127
The solution was tidy, but I'm not sure calling the referenced object a "child" of the dbobject makes much sense. Also, I found another limitation (and one I cannot offer a fix for): Sometimes not all the dependencies for views come through. I have a view with multiple CTEs. In one environment 5 of 6 references were found. In another, a different set of 5 of the 6 references were found. I cannot fathom why that would happen.
ksatpute123
ksatpute123
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2181 Visits: 386
Sorry for the late reply. Thanks for your feedback.

Calling the referenced object a "child" of the dbobject was something of requirement at my end. I assumed people using the code may change it as per their needs, so I kept it as it is.

I couldn't recreate the scenario you pointed out. It would be helpful if you could share more details about it so the issue can be tackled.
janis.l.murphy
janis.l.murphy
SSC-Enthusiastic
SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)SSC-Enthusiastic (121 reputation)

Group: General Forum Members
Points: 121 Visits: 127
I can't think of a good way to produce an example of the issue I found. Just imagine that your view has more than one CTE and each CTE has different references. In my database, I found that only some of the references were logged in the sys.sql_dependencies table. Oddly enough, in other environments the same thing happened, but a different subset of referenced objects were logged. Perhaps it had something to do with changes to the referenced objects. Perhaps the view just needed to be re-compiled in order that the dependencies be updated. The problem is (if I have to re-compile everything) that wouldn't be feasible, I think.
SQL Refactor Studio Team
SQL Refactor Studio Team
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 82
You can try a free addin for SQL Server Management Studio - SQL Refactor Studio (http://sqlrefactorstudio.com/)

Key Features:
- Advanced Search dependences of object (databases, files on disk, query editor)
- Advanced Search dependencies free text (in databases, files on disk, query editor)
- Refactoring "Rename"
- Refactoring "Add CRUD Methods"
- Refactoring "Move columns"
- Refactoring "Add lookup table"
- Formatting SQL code
- And many other useful features!

______________________________
Sincerely,
SQL Refactor Studio Team
http://sqlrefactorstudio.com/
mxy
mxy
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1698 Visits: 4087
will this work on SQL 2K5 instance ?
Iwas Bornready
Iwas Bornready
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35122 Visits: 886
Thanks. I changed the column names to be a bit more friendly to me.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search