Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
?-- =============================================
-- Description: Based on supplied batchlogid, set the batchlog status
--
-- Maintenance Log:
--
-- Update By Update Date Description
-- ----------- --------- ----------------------------
-- =============================================
CREATE PROCEDURE dbo.uspSetBatchLogStatus
@batchLogId bigint,
@batchRecordCount bigint,
@maxSourceBatchNumber bigint, --the maximum source batch number from the incoming batch of records
@loadStatus varchar (50),
@filePathName varchar(400) = null --this is here, just in case there's a bad file, we can change the filepath
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
BEGIN TRY
--In SSIS, not possible to pass nullable params it seems. So need to factor for that
IF LTRIM(RTRIM(@filePathName)) = ''
BEGIN
SET @filePathName = null;
END
UPDATE BatchLogs
SET BatchRecordCount = @batchRecordCount
, LoadStatus = @loadStatus
, SourceBatchNumber = @maxSourceBatchNumber
, FilePathName = @filePathName
WHERE BatchLogID = @batchLogId;
END TRY
BEGIN CATCH
PRINT 'There was an error setting status on the Batch log' + CHAR(13);
THROW;
END CATCH
END
GO