spAddUpdate_DonorScrollers
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PKID | int | INOUT | |
@ContentID | int | IN | |
@Fundraisers | ntext | IN | |
@GiftTypes | ntext | IN |
Definition
Copy
create procedure dbo.spAddUpdate_DonorScrollers (
@PKID int output,
@ContentID int,
@Fundraisers ntext,
@GiftTypes nText
)
as
begin
declare @Count int
begin transaction
select @Count = count(ContentID) from dbo.DonorScrollers where ContentID = @ContentID
if (@Count = 0)
begin
insert into dbo.DonorScrollers
(
ContentID,
FundraiserIDs,
GiftTypes
)
values
(
@ContentID,
@Fundraisers,
@GiftTypes
)
select @PKID = @ContentID
end
else
update dbo.DonorScrollers
set
FundraiserIDs = @Fundraisers,
GiftTypes = @GiftTypes
where ContentID = @PKID
commit transaction
end