USP_DATAFORMTEMPLATE_VIEW_SPONSORSHIPOPPORTUNITYSOLESPONSORSHIP
The load procedure used by the view dataform template "Sponsorship Opportunity Sole Sponsorship Info View Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@SPONSORSHIPLOCATIONID | uniqueidentifier | INOUT | SPONSORSHIPLOCATIONID |
@SPONSORCOUNT | smallint | INOUT | SPONSORCOUNT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_SPONSORSHIPOPPORTUNITYSOLESPONSORSHIP
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@SPONSORSHIPLOCATIONID uniqueidentifier = null output,
@SPONSORCOUNT smallint = null output
)
as
set nocount on;
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 0;
-- populate the output parameters, which correspond to fields on the form. Note that
-- we set @DATALOADED = 1 to indicate that the load was successful. Otherwise, the system
-- will display a "no data loaded" message.
select @DATALOADED = 1,
@SPONSORSHIPLOCATIONID = SPONSORSHIPOPPORTUNITY.SPONSORSHIPLOCATIONID,
@SPONSORCOUNT = count(SPONSORSHIP.ID)
from dbo.SPONSORSHIPOPPORTUNITY
left outer join dbo.SPONSORSHIP on SPONSORSHIP.SPONSORSHIPOPPORTUNITYID = SPONSORSHIPOPPORTUNITY.ID and SPONSORSHIP.STATUSCODE in(0,1)
where SPONSORSHIPOPPORTUNITY.ID = @ID
group by SPONSORSHIPOPPORTUNITY.SPONSORSHIPLOCATIONID
return 0;