USP_EMAILLIST_SETREFRESHSTATUS

Parameters

Parameter Parameter Type Mode Description
@EMAILLISTID int IN
@STATUS int IN
@ACQUIREDMESSAGE ntext IN
@ACQUIREDRECORDCOUNT int IN

Definition

Copy


CREATE procedure dbo.USP_EMAILLIST_SETREFRESHSTATUS
(
    @EMAILLISTID int,
    @STATUS int,
    @ACQUIREDMESSAGE ntext,
    @ACQUIREDRECORDCOUNT int
)
as
begin   
    if @STATUS = 0 or @STATUS = 2
        -- 0 and 2 correspond to starting a refresh so update the start date.

        update [dbo].EmailList
        set
            [AcquiredStatus]=@STATUS,
            [AcquiredMsg]=@ACQUIREDMESSAGE,
            [AcquiredStartDate]=GETUTCDATE(),
            [AcquiredRecordCount]=@ACQUIREDRECORDCOUNT
        where ID=@EMAILLISTID
    else
        -- This is the completion of a refresh so update the end date.

        update [dbo].EmailList
        set
            [AcquiredStatus]=@STATUS,
            [AcquiredMsg]=@ACQUIREDMESSAGE,
            [AcquiredDate]=GETUTCDATE(),
            [AcquiredRecordCount]=@ACQUIREDRECORDCOUNT
        where ID=@EMAILLISTID
end