Stored Procedures [dbo].[InsertMultipleMobileCrewTimesSendToXmlInterface]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inPunchInMobileCrewTimeIDsvarchar(max)max
@inPunchOutMobileCrewTimeIDsvarchar(max)max
@inXmlInterfaceNamevarchar(50)50
@inSentBySysUserIdint4
@inSentDateTimedatetime8
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/*
* Creates multiple records in the MobileCrewTimeSendToXmlInterface table, which indicate that some time punches
* in the MobileCrewTime table were sent to an XmlInterface.
*/


create procedure [dbo].[InsertMultipleMobileCrewTimesSendToXmlInterface]
    @inPunchInMobileCrewTimeIDs varchar(max),
    @inPunchOutMobileCrewTimeIDs varchar(max),
    @inXmlInterfaceName varchar(50),
    @inSentBySysUserId int,
    @inSentDateTime datetime
as
set nocount on

declare @theInterfaceId int
select @theInterfaceId = XmlInterfaceID from XmlInterface where VendorName = @inXmlInterfaceName

insert into dbo.MobileCrewTimeSentToXmlInterface
(
    MobileCrewTimeFID,
    XmlInterfaceFID,
    IsBeginTime,
    SentOn,
    SentByFID
)
select
    MobileCrewTimeIDs.Item,
    @theInterfaceId,
    1,
    @inSentDateTime,
    @inSentBySysUserId
from dbo.ParseMultiValuedIntegerParameter( @inPunchInMobileCrewTimeIDs, ',' ) MobileCrewTimeIDs
where MobileCrewTimeIDs.Item is not null
union all
select
    MobileCrewTimeIDs.Item,
    @theInterfaceId,
    0,
    @inSentDateTime,
    @inSentBySysUserId
from dbo.ParseMultiValuedIntegerParameter( @inPunchOutMobileCrewTimeIDs, ',' ) MobileCrewTimeIDs
GO
GRANT EXECUTE ON  [dbo].[InsertMultipleMobileCrewTimesSendToXmlInterface] TO [MssExec]
GO
Uses