Reputation: 810
I need to list down all object inside an object and related columns they are returning from source table.
For e.g.
Procedure usp_UspTask
is calling 3 functions
fnt_Task1
fnt_Task2
fnt_Task3
These three functions are adjoining and returning select list to usp_UspTask
.
Now I want that list of tables and columns which are using inside all above three functions.
Is there any query which can return this information? I know about information schema but need related information form there.
Upvotes: 1
Views: 1290
Reputation: 7753
For SQL Server 2008 you can use sp_depends which returns all objects that this object depends upon and all objects which depend upon this object:
EXEC SP_DEPENDS fnt_Task1
This returns two datasets:
Note sp_depends is deprecated and for 2012 and later you should use:
Upvotes: 2