Solved

Parent procedure or function name

Posted on 2009-05-14
7
580 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
  • 4
  • 2
7 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 50 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now