I have a sp that I would like to convert into a view. Any Ideas on this?
Thanks
MikeD
TP_ProcLU (
@AllCovered char(1),
@PayorPlankey int
)
AS
If @AllCovered is null OR upper(@AllCovered)='T' OR @PayorPlankey is null
Begin
select p.IntProcCode,p.CPTCode,p.Descr,p.Prockey
from bil_procedures p
order by p.intproccode
End
Else Begin
select p.IntProcCode,p.CPTCode,p.Descr,p.prockey
from bil_procedures p
left join BIL_CoveredProcs cp on
p.prockey=cp.prockey
where cp.payorplankey=@PayorPlankey
order by p.intproccode
End
Thanks
MikeD
TP_ProcLU (
@AllCovered char(1),
@PayorPlankey int
)
AS
If @AllCovered is null OR upper(@AllCovered)='T' OR @PayorPlankey is null
Begin
select p.IntProcCode,p.CPTCode,p.Descr,p.Prockey
from bil_procedures p
order by p.intproccode
End
Else Begin
select p.IntProcCode,p.CPTCode,p.Descr,p.prockey
from bil_procedures p
left join BIL_CoveredProcs cp on
p.prockey=cp.prockey
where cp.payorplankey=@PayorPlankey
order by p.intproccode
End