USP_WIDGETEXTENSIONAUDIT_SETDELETEDCHANGEAGENTID
Used to update the audit delete change agent after issuing a standard 'Delete from...' statement on the WIDGETEXTENSION 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: 3/19/2013 1:11:27 AM
Assembly Version: Blackbaud.AppFx.Platform.SqlClr, Version=3.0.504.0, Culture=neutral, PublicKeyToken=null
Copyright Blackbaud
*/
CREATE PROCEDURE dbo.USP_WIDGETEXTENSIONAUDIT_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.WIDGETEXTENSIONAUDIT
SET AUDITCHANGEAGENTID=@CHANGEAGENTID
WHERE AUDITRECORDID=@ID
AND AUDITTYPECODE= 2; --2 = Before Delete
if @@error<>0 return -7;
return 0;