USP_DATAFORMTEMPLATE_EDITLOAD_FAFNFGCAMPAIGNLEVEL
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | |
@CURRENTAPPUSERID | uniqueidentifier | IN | |
@DATALOADED | bit | INOUT | |
@TSLONG | bigint | INOUT | |
@NAME | nvarchar(100) | INOUT | |
@NFGCAMPAIGNID | uniqueidentifier | INOUT | |
@CONTACTID | uniqueidentifier | INOUT | |
@SITES | xml | INOUT | |
@SITEREQUIRED | bit | INOUT | |
@FAFFRIENDLYURL | nvarchar(200) | INOUT | |
@TOTALREVENUEGOAL | money | INOUT | |
@DONORSGOAL | int | INOUT | |
@PARTICIPANTSGOAL | int | INOUT | |
@GROUPSGOAL | int | INOUT | |
@COMMUNICATIONSGOAL | int | INOUT | |
@PARENTID | uniqueidentifier | INOUT | |
@HIERARCHYPATHLEVEL | int | INOUT | |
@NOTMATCH | bit | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_FAFNFGCAMPAIGNLEVEL(
@ID uniqueidentifier,
@CURRENTAPPUSERID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@NAME nvarchar(100) = null output,
@NFGCAMPAIGNID uniqueidentifier = null output,
@CONTACTID uniqueidentifier = null output,
@SITES xml = null output,
@SITEREQUIRED bit = null output,
@FAFFRIENDLYURL nvarchar(200) = null output,
@TOTALREVENUEGOAL money = null output,
@DONORSGOAL int = null output,
@PARTICIPANTSGOAL int = null output,
@GROUPSGOAL int = null output,
@COMMUNICATIONSGOAL int = null output,
@PARENTID uniqueidentifier = null output,
@HIERARCHYPATHLEVEL int = null output,
@NOTMATCH bit = null output
)
as
set nocount on;
-- be sure to set these, in case the select returns no rows
set @DATALOADED = 0
set @TSLONG = 0
set @NOTMATCH = 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. Also note that we fetch the TSLONG so that concurrency
-- can be considered.
select
@DATALOADED = 1,
@TSLONG = TSLONG,
@NAME = NAME,
@NFGCAMPAIGNID = NFGCAMPAIGNID,
@CONTACTID = CONTACTID,
@TOTALREVENUEGOAL = TOTALREVENUEGOAL,
@DONORSGOAL = DONORSGOAL,
@PARTICIPANTSGOAL = PARTICIPANTSGOAL,
@GROUPSGOAL = GROUPSGOAL,
@COMMUNICATIONSGOAL = COMMUNICATIONSGOAL,
@PARENTID = (select PARENTSITE.ID from dbo.FAFNFGCAMPAIGNLEVEL as PARENTSITE where PARENTSITE.HIERARCHYPATH = FAFNFGCAMPAIGNLEVEL.HIERARCHYPATH.GetAncestor(1)),
@HIERARCHYPATHLEVEL = HIERARCHYPATH.GetLevel()
from dbo.FAFNFGCAMPAIGNLEVEL
where ID = @ID
set @SITEREQUIRED = dbo.UFN_SITEREQUIREDFORUSER(@CURRENTAPPUSERID);
select @SITES = (
SELECT FNFGLS.[ID], FNFGLS.[SITEID], S.NAME
FROM dbo.[FAFNFGCAMPAIGNLEVELDISPLAYSITE] FNFGLS
join dbo.[SITE] S on S.ID = FNFGLS.SITEID
where FNFGLS.NFGCAMPAIGNLEVELID = @ID
for xml raw('ITEM'),type,elements,root('SITES'),BINARY BASE64 )
return 0;