[dbo].[InsertMultipleMobileCrewTimesSendToXmlInterface]
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