SQLTeam.com | Weblogs | Forums

How to extract a view dependency and create a relationship

Hi Experts, I put myself about 2 or max 3 /10 and manage my work by getting tables i need to do analysis. However, the problem I have needs some smart help.
I have SSMS with views existing already.
Environment: SQL Server Management Studio - SQL

I have about 100 views, each view has many From -- tables and refers to another view and this goes on, I need help
Please can you help me with how should I approach these issues, is there a script that evaluates these relationships to other views? I need this as developers get the requirements.
My outputs needed: View Dependencies, Tables it refers to the base table etc.

Please advise and thank you.

Take a look at this page, in particular the section labled Example 5: Finding Nested Views with more than 4 levels

1 Like

Thanks a lot @JamesK
I will try these steps tomorrow. Is that ok to seek a clarification of the arguments I need to pass etc. Thank you very much and this seems to solve my issue if I can get this right to execute? Thanks a ton.

@JamesK really thank you, today in office I tried example 5 and a few others, but I only got headers with no data. hmm I removed the where check object.name ="V" OR object.ID = xxx I fed the view ID there and did all kinds of combinations / also removing where statement completely but still only empty headers. Any ideas please