spAddUpdate_SiteVolunteerOps
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PKID | int | INOUT | |
@ContentID | int | IN | |
@JobQueryID | int | IN | |
@ConstituentCodeID | int | IN | |
@EmailTemplateID | int | IN | |
@VolunteerTypeID | int | IN | |
@JobAttributesToDisplay | ntext | IN |
Definition
Copy
CREATE PROCEDURE dbo.spAddUpdate_SiteVolunteerOps
(
@PKID int output,
@ContentID int,
@JobQueryID int,
@ConstituentCodeID int,
@EmailTemplateID int,
@VolunteerTypeID int,
@JobAttributesToDisplay ntext
)
AS
BEGIN
DECLARE @Count int
BEGIN TRANSACTION
SELECT @Count = COUNT(ContentID) FROM SiteVolunteerOps WHERE ContentID = @ContentID
IF (@Count = 0)
BEGIN
INSERT INTO SiteVolunteerOps
(
ContentID,
JobQueryID,
ConstituentCodeID,
EmailTemplateID,
VolunteerTypeID,
JobAttributesToDisplay
)
VALUES
(
@ContentID,
@JobQueryID,
@ConstituentCodeID,
@EmailTemplateID,
@VolunteerTypeID,
@JobAttributesToDisplay
)
SELECT @PKID = @ContentID
END
ELSE
UPDATE SiteVolunteerOps
SET
JobQueryID = @JobQueryID,
ConstituentCodeID = @ConstituentCodeID,
EmailTemplateID = @EmailTemplateID,
VolunteerTypeID = @VolunteerTypeID,
JobAttributesToDisplay = @JobAttributesToDisplay
WHERE ContentID = @PKID
COMMIT TRANSACTION
END