USP_RESERVATIONRATESCALERESOURCEAUDIT_SETDELETEDCHANGEAGENTID

Used to update the audit delete change agent after issuing a standard 'Delete from...' statement on the RESERVATIONRATESCALERESOURCE 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:  1/27/2010 6:48:28 PM
Assembly Version:  Blackbaud.AppFx.Platform.SqlClr, Version=2.5.465.0, Culture=neutral, PublicKeyToken=null
Copyright Blackbaud
*/
CREATE PROCEDURE dbo.USP_RESERVATIONRATESCALERESOURCEAUDIT_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.RESERVATIONRATESCALERESOURCEAUDIT
    SET AUDITCHANGEAGENTID=@CHANGEAGENTID
    WHERE AUDITRECORDID=@ID
    AND   AUDITTYPECODE= 2; --2 = Before Delete


    if @@error<>0 return -7;

    return 0;