USP_BANKACCOUNTDEPOSITCORRECTIONNOTEAUDIT_SETDELETEDCHANGEAGENTID
Used to update the audit delete change agent after issuing a standard 'Delete from...' statement on the BANKACCOUNTDEPOSITCORRECTIONNOTE table.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The ID of the record that was deleted. |
@CHANGEAGENTID | uniqueidentifier | IN | The ID of the change agent who invoked the delete. |
Definition
Copy
/*
Generated by Blackbaud AppFx Platform
Date: 10/27/2011 12:07:08 PM
Assembly Version: Blackbaud.AppFx.Platform.SqlClr, Version=2.92.537.0, Culture=neutral, PublicKeyToken=null
Copyright Blackbaud
*/
CREATE PROCEDURE dbo.USP_BANKACCOUNTDEPOSITCORRECTIONNOTEAUDIT_SETDELETEDCHANGEAGENTID(@ID UNIQUEIDENTIFIER,@CHANGEAGENTID UNIQUEIDENTIFIER)
AS
/*
Since there is no way to explicitly specify a non-default changeagent id via a
standard 'Delete from ...' statement this SP can be used to change the AUDITCHANGEAGENTID after a deletion.
*/
set nocount on;
if @CHANGEAGENTID is null
BEGIN
raiserror ('Unable to update audit delete AUDITCHANGEAGENTID - @CHANGEAGENTID cannot be null', 16,1);
return 5;
END
UPDATE dbo.BANKACCOUNTDEPOSITCORRECTIONNOTEAUDIT
SET AUDITCHANGEAGENTID=@CHANGEAGENTID
WHERE AUDITRECORDID=@ID
AND AUDITTYPECODE= 2; --2 = Before Delete
if @@error<>0 return -7;
return 0;