USP_DATALIST_ONLINEPROGRAMEVENTONSALE_BYPROGRAM
Events for a program on sale in the specified date range via online sales.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PROGRAMID | uniqueidentifier | IN | Input parameter indicating the context ID for the data list. |
@STARTDATETIME | datetime | IN | |
@ENDDATETIME | datetime | IN | |
@INCLUDESOLDOUT | bit | IN | |
@NAME | nvarchar(150) | IN | |
@EXCLUDEDATE | date | IN | |
@LIMITROWS | int | IN | |
@MAXROWS | int | IN | Input parameter indicating the maximum number of rows to return. |
@EXCLUDEOFFSALE | bit | IN |
Definition
Copy
CREATE procedure dbo.USP_DATALIST_ONLINEPROGRAMEVENTONSALE_BYPROGRAM
(
@PROGRAMID uniqueidentifier = null,
@STARTDATETIME datetime = null,
@ENDDATETIME datetime = null,
@INCLUDESOLDOUT bit = null,
@NAME nvarchar(150) = null,
@EXCLUDEDATE date = null,
@LIMITROWS int = 0,
@MAXROWS int = 0, --the presence of this parameter causes its value (passed in by the platform as 501) to govern the maximum number of rows returned in the datalist; if LIMITROWS is a higher number, this still only returns MAXROWS
--see the newer "Online Program Event On Sale By Program Data List, to limit" for this same functionality but without the MAXROWS parameter
@EXCLUDEOFFSALE bit = 0 --maintaining old behavior
)
as
set nocount on;
select
EVENTSONSALE.ID,
EVENTSONSALE.NAME,
EVENTSONSALE.AVAILABILITY,
EVENTSONSALE.STARTDATE,
EVENTSONSALE.STARTTIME,
EVENTSONSALE.ENDTIME,
EVENTSONSALE.URL,
[EVENT].CAPACITY,
case
when [EVENT].SUPERCEDESPROGRAMPUBLICDESCRIPTION = 0 then isnull(PROGRAM.PUBLICDESCRIPTIONHTML , [EVENT].PUBLICDESCRIPTIONHTML)
else [EVENT].PUBLICDESCRIPTIONHTML
end PUBLICDESCRIPTION
from dbo.UFN_ONLINEPROGRAMEVENTONSALE_BYPROGRAM_2 (
@PROGRAMID,
@STARTDATETIME,
@ENDDATETIME,
@INCLUDESOLDOUT,
@NAME,
@EXCLUDEDATE,
@LIMITROWS,
@MAXROWS,
@EXCLUDEOFFSALE
) EVENTSONSALE
inner join dbo.[EVENT]
on EVENTSONSALE.ID = [EVENT].ID
left outer join dbo.PROGRAM
on [EVENT].PROGRAMID = PROGRAM.ID