Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 how to find dependencies for stored proc

Author  Topic 

dasu
Posting Yak Master

104 Posts

Posted - 2004-10-19 : 06:16:56
iam facing one problem
like this
here sp1 ie stored procedure1


sp1
begin
sp2
end

here iam calling sp2 in sp1
so this
sp1 and sp2 .....
all stored procedures are in a single folder
i wrote one batch script which will execute all stored procedures
which are there in that folder.
but here i hve some dependencies so i have to execute some of them
before executing some sps
so.
i ahve to find dependencies
and
i ahve to find execution status (whether it s allready executed or not)
where can i get this all information in systables
please
suggest me proper solution
regards
dasu.g

surefooted
Posting Yak Master

188 Posts

Posted - 2004-10-19 : 09:41:21
You can use sp_depends to see what object references another object. To see if a stored procedure has been executed or not, use profiler to run a trace.

-Jon
Now a "Yak Posting Veteran".
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-10-19 : 14:31:42
In my experience sysdepends is not very reliable. If you have self-referencing SProcs then sysdepends will not be properly, and accurately, formed as the Sprocs are created. And then it will be unreliable thereafter.

Instead of

DROP SPRoc1
DROP SPRoc2
CREATE SPRoc1
CREATE SPRoc2

(as EM "Generate SQL" creates)
we do

DROP SPRoc1
CREATE SPRoc1

DROP SPRoc2
CREATE SPRoc2

which makes sysdepends a little more reliable - but, even so, if we get "Unable to update sysdepends ..." type messages we re-run the script until there are no such message.

Kristen
Go to Top of Page

dasu
Posting Yak Master

104 Posts

Posted - 2004-10-20 : 04:35:33
thanks for solution
but i want some what clear


so i need how many tables are populated when we try to execute stored procedure .
pleas tell me the list of system tables
please
make me favour
regards
dasu.g
Go to Top of Page
   

- Advertisement -