USP_SYSTEMROLEPERM_REPORTAUDIT_SETDELETEDCHANGEAGENTID
Used to update the audit delete change agent after issuing a standard 'Delete from...' statement on the SYSTEMROLEPERM_REPORT 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: 12/17/2008 2:14:05 AM
Assembly Version: Blackbaud.AppFx.Platform.SqlClr, Version=1.7.1271.0, Culture=neutral, PublicKeyToken=null
Copyright Blackbaud
*/
CREATE PROCEDURE dbo.USP_SYSTEMROLEPERM_REPORTAUDIT_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.SYSTEMROLEPERM_REPORTAUDIT
SET AUDITCHANGEAGENTID=@CHANGEAGENTID
WHERE AUDITRECORDID=@ID
AND AUDITTYPECODE= 2; --2 = Before Delete
if @@error<>0 return -7;
return 0;