Need a bit of assistance here.
We have Stored proc designed in our live system which queries views, function, linked server((which queries tables and its columns)) etc
Is their a quick and easy way of getting list of all views(so what tables and columns is it referencing to) , temp tables(so what tables and column is it referencing to),tables (what column is it referencing too from a specific SP.
So for example
So far I have been using this
case when referenced_Schema_name = '' or referenced_schema_name is null then 'dbo' else referenced_schema_name end as [referenced_schema_name],
((case when referenced_Schema_name = '' or referenced_schema_name is null then 'dbo' else referenced_schema_name end )+'.'+referenced_entity_name) as [Table],
case when referenced_database_name in ('Catalogue','Reflex') then referenced_database_name else NULL end as [Database]
This query is telling me what database is being used, what table is being used and what columns are being queried .
Can i have an assistance of a similar like one combined query which can be used to get all database, views(what table and column is being referenced), temp tables(what table and column is being referenced), functions