USP_BBNC_COMMITSIGNUPUPDATEPRIMARYALUMNI
Updates a constituent's primary alumni class of information from a Blackbaud Internet Solutions signup transaction to the system from a given batch.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | |
@CLASSOF | smallint | IN | |
@CHANGEAGENTID | uniqueidentifier | IN | |
@CHANGEDATE | datetime | IN |
Definition
Copy
CREATE procedure dbo.USP_BBNC_COMMITSIGNUPUPDATEPRIMARYALUMNI
(
@ID uniqueidentifier = null,
@CLASSOF smallint = 0,
@CHANGEAGENTID uniqueidentifier = null,
@CHANGEDATE datetime = null
) as
set nocount on;
declare @SCHOOLID uniqueidentifier;
if @ID is null
begin
raiserror('The constituent ID is required',16,1);
return -2;
end
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
if @CHANGEDATE is null
set @CHANGEDATE = getdate();
select
@SCHOOLID = [ID]
from
dbo.EDUCATIONALHISTORY
where
[CONSTITUENTID] = @ID and [ISPRIMARYRECORD] = 1;
if @SCHOOLID is null
begin
raiserror('There is no primary education record for this constituent.',16,1);
return -2;
end
begin try
update dbo.EDUCATIONALHISTORY set
[CLASSOF] = @CLASSOF,
[CHANGEDBYID] = @CHANGEAGENTID,
[DATECHANGED] = @CHANGEDATE
where
[ID] = @SCHOOLID
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;