June 20, 2011 at 2:46 pm
Hi,
I am new to sql server 2005. I need to find dependencies between database objects. I have used SQL dependency tracker tool by red gate. But it will show only those dependencies which are written into DB metadata.
For example, if you create Stored Procedure (Parent) which calls other SP (child) which weren't created yet (or not saved to DB yet), it will miss such dependency.
Is there any way to find such dependencies in SQL server 2005?
Thanks in advance.
June 20, 2011 at 4:38 pm
I do not know of a tool that will piece that together for you.
If you know specifically what you're looking for you could search the definitions of the all sql modules (includes procs, triggers and functions):
SELECT *
FROM sys.sql_modules
WHERE definition LIKE '%some_proc_name%' ;
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
June 21, 2011 at 8:15 am
Thanks for the reply.
But I want to find the dependency of those objects which are not yet written in database.
Is there any way?
June 21, 2011 at 8:20 am
I gave you a way.
If procA refers to procB and you only compile procA in the database then this query will show you that procA refers to procB:
SELECT *
FROM sys.sql_modules
WHERE definition LIKE '%procB%' ;
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply