• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 578
  • Last Modified:

SQL Server Views - Dependency and INFORMATION_SCHEMA.VIEW_TABLE_USAGE

I'm trying to find out all dependencies for given views.
I tried all available method
- EXEC sp_depends
- EXEC sp_MSdependencies
- sys.sql_dependencies table
- INFORMATION_SCHEMA.VIEW_TABLE_USAGE

All above work only few views and not all.
Why is this information available for only few and not all views?
0
rahulsurya
Asked:
rahulsurya
  • 2
3 Solutions
 
chapmandewCommented:
dependencies only work if sql is able to keep track of the dependency when the object is created....not accurate really in versions previous to 2008.
0
 
rahulsuryaAuthor Commented:
Can i rebuild dependencies or is there a way i can find out all base tables a view uses?
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
SQL Server's internal tracking of dependencies is not accurate and hence there might be some information missing for some views..
And hence the below third party tools

* Red gate Dependency Tracker (http://www.red-gate.com/products/SQL_Dependency_tracker/index.htm)
* Apex SQL Clean (http://www.apexsql.com/sql_tools_clean.asp)

gained more popularity in these areas..
0
 
chapmandewCommented:
you could, but there isn't an easy way to go it, unfortunately.

apexsql.com has a dependency tracker that is really good for doing this. I use it exclusively rather than rely on how sql tracks the dependencies for 2005 and prior instances.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now