So, in the project I'm working on, there is a stored procedure (which we will call SP_Premium
) that gets me a few values, including a Premium
number, which I need.
I've figured out that I can't use Linq to EF to solve my problem, so I should use a stored procedure.
The problem here is, I need the Premium
number from SP_Premium
inside my new stored procedure.
How do I add this SP_Premium
to my own stored procedure and get all the values out?
ALTER PROCEDURE [dbo].[SP_Premium]
@RequestId int = 104622
AS
BEGIN
declare @precision int = 10
select
P.Premium
P.ONP
,P.ONEP
,P.retention
,P.retentionValue
,P.retentionValueEndorsement
,P.OCP
,P.OCEP
,P.cededShare
,T.amount
,T.endorsementAmount
,T.cededAmount
,T.cededEndorsementAmount
,RC.cost
,RC.endorsementCost
from requestbackoffice bo
cross apply [dbo].[Report_Get_BO_original_premium](@RequestId,@precision) P
outer apply [dbo].[Report_Get_BO_taxes](@RequestId,@precision) T
outer apply [dbo].[Report_Get_BO_reinsurance_costs](@RequestId,@precision) RC
where bo.requestId=@requestId
END