USP_DATALIST_RATESCALEPROGRAM
Returns all programs belonging to a rate scale.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CONTEXTID | uniqueidentifier | IN | Input parameter indicating the context ID for the data list. |
Definition
Copy
CREATE procedure dbo.USP_DATALIST_RATESCALEPROGRAM
(
@CONTEXTID uniqueidentifier
)
as
begin
set nocount on;
declare @INCLUDEALLPROGRAMS bit
select
@INCLUDEALLPROGRAMS = INCLUDEALLPROGRAMS
from dbo.RATESCALE
where ID = @CONTEXTID
if @INCLUDEALLPROGRAMS = 1
begin
select
null,
'All programs included' as PROGRAMNAME
end
else
begin
select
RATESCALEPROGRAM.ID,
PROGRAM.NAME as PROGRAMNAME
from dbo.RATESCALEPROGRAM
inner join dbo.PROGRAM on
RATESCALEPROGRAM.PROGRAMID = PROGRAM.ID
where RATESCALEID = @CONTEXTID
end
end