February 2, 2012 at 11:22 pm
declare @objid as int
select @objid=object_id from sys.objects where name='substitute your Procedurename'
if exists(select id from sysdepends where depid=@objid)
begin
select name as ParentProcedure from sys.objects where object_id in
(select id from sysdepends where depid=@objid)
end
else
begin
print 'No Parent Procedure Found'
end
will this work?Plz reply
February 4, 2012 at 12:32 am
You can use the below to find out the parent procedure
SELECT*
FROMsys.dm_sql_referencing_entities('dbo.' + @ChildProcedureName ,'OBJECT')
February 4, 2012 at 4:42 am
Duplicate post. No replies please.
Original post: http://www.sqlservercentral.com/Forums/FindPost1245459.aspx
@deepikamm: Is there any specific reason for starting a new thread with the very same question?
February 4, 2012 at 7:21 am
didnt get reply for >2 days.thats y posted it here.
Thanks for replying..!
February 5, 2012 at 5:33 am
Sorry But your Question ,As i thought something strange ,You want some one to just run a Query for you!
:w00t:
February 9, 2012 at 3:22 am
I wanted someone to confirm that the query posted by me will display parent procedure.
February 9, 2012 at 4:16 am
deepikamm (2/2/2012)
declare @objid as intselect @objid=object_id from sys.objects where name='substitute your Procedurename'
if exists(select id from sysdepends where depid=@objid)
begin
select name as ParentProcedure from sys.objects where object_id in
(select id from sysdepends where depid=@objid)
end
else
begin
print 'No Parent Procedure Found'
end
will this work?Plz reply
Yes it should work. Have you tested it with some sample ??
Ooops, Its already resolved right ?
February 10, 2012 at 6:31 am
yes i tested it.It worked fine.Before using it,i wanted sqlexperts to check and confirm the script.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply