Stored Procedures [dbo].[LogAdpSend]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inMobileCrewTimeIdsvarchar(max)max
@inMobileCrewTimeSentStatusvarchar(16)16
@inSuccessbit1
@inAdpBadgevarchar(512)512
@inLocationvarchar(50)50
@inTimeclockvarchar(64)64
@inJsonMessagevarchar(max)max
@inIsReceivedJsonbit1
@inNumberOfPunchesint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/**
*    Logs the results of sending time punches to ADP for an employee.
*
*    @param @inMobileCrewTimeId Comma-delimited list of MobileCrewTime primary key of the time punches that were sent to ADP in this batch.
*    @param @inMobileCrewTimeSentStatusId Primary key of a MobileCrewTimeSentStatus record, which tracks the status of sending a punch to ADP (this will be the same status for all punches in the batch).
*    @param @inSuccess Flag indicating whether or not the operation was successful:
*        (if we are logging JSON that was sent, this indicates that the web request succeeded;
*         if we are logging JSON that was received, this indicates whether or not ADP returned a success status code.)
*    @param @inAdpBadge ADP badge number of the employee whose time punches were sent to ADP.
*    @param @inLocation ADP location identifier that was sent to ADP.
*    @param @inTimeclock ADP timeclock identifier that was sent to ADP.
*    @param @inJsonMessage JSON message that was sent to ADP.
*    @param @inIsReceivedJson Flag indicating whether or not the @inJsonMessage param contains JSON that was sent or received.
*    @param @inNumberOfPunches Number of punches that were sent to ADP.
*/

CREATE PROCEDURE [dbo].[LogAdpSend]
    @inMobileCrewTimeIds varchar(max),
    @inMobileCrewTimeSentStatus varchar(16),
    @inSuccess bit,
    @inAdpBadge varchar(512),
    @inLocation varchar(50),
    @inTimeclock varchar(64),
    @inJsonMessage varchar(max),
    @inIsReceivedJson bit,
    @inNumberOfPunches int
as

-- Look up the primary key of the status
declare @theMobileCrewTimeStatusId int
select @theMobileCrewTimeStatusId = MobileCrewTimeSentStatusID
from MobileCrewTimeSentStatus
where [Status] = @inMobileCrewTimeSentStatus

insert into [dbo].[AdpExportLog]
(
    [TimeStamp],
    [Success],
    [AdpBadge],
    [Location],
    [Timeclock],
    [JsonMessage],
    [NumberOfPunches],
    [MobileCrewTimeFIDs],
    [MobileCrewTimeSentStatusFID],
    [IsReceivedJson]
)
select
    getdate(),
    @inSuccess,
    @inAdpBadge,
    @inLocation,
    @inTimeclock,
    @inJsonMessage,
    @inNumberOfPunches,
    @inMobileCrewTimeIds,
    @theMobileCrewTimeStatusId,
    @inIsReceivedJson
GO
GRANT EXECUTE ON  [dbo].[LogAdpSend] TO [MssExec]
GO
Uses