?
Solved

Parent procedure or function name

Posted on 2009-05-14
7
Medium Priority
?
619 Views
Last Modified: 2012-05-07
how to get parent procedure name in child procedure name
say
proc A
(
call Procc B
 )

proc B
(
--NEED PROC A NAME
)

0
Comment
Question by:jindalankush
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 200 total points
ID: 24383377
You can't predict which procedure has called your PROC B. it could be called from PROC A or may be from PROC D or C anywhere. you can have parameter so that you can decide which procedure has called PROC B.
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24383394
create proc b (@procName varchar)
as
begin
select @procname
end


create proc a
as
begin
exec b 'a'
end

create proc c
as
begin
exec b 'c'
end


--run SP and check.
exec a

exec c
0
 
LVL 4

Author Comment

by:jindalankush
ID: 24383409
i need that proc name either its a proc A or proc D.
i can not pass any parameter
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:RiteshShah
ID: 24383434
well in that case, I don't think so it is possible.
0
 
LVL 4

Author Comment

by:jindalankush
ID: 24409314
how can we find parent procedure name
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24409322
as I told you before also, it is not possible with the way you want. SQL Server is RDBMS not Object Oriented Language.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question