spMFProcessBatchDetail_Insert

Signature

EXEC dbo.spMFProcessBatchDetail_Insert
    @ProcessBatch_ID = NULL,
    @LogType = N'Status',
    @LogText = N'',
    @LogStatus = N'Start',
    @StartTime = GETUTCDATE(),
    @MFTableName = N'',
    @Validation_ID = NULL,
    @ColumnName = NULL,
    @ColumnValue = NULL,
    @Update_ID = NULL,
    @LogProcedureName = N'',
    @LogProcedureStep = N'',
    @ProcessBatchDetail_ID = NULL OUTPUT,
    @debug = 0;

Returns

INT: 1 on success; -1 on error.

Parameters

@ProcessBatch_ID
  • Type: INT

  • Required: No

  • Description: ProcessBatch logging ID.

@LogType
  • Type: NVARCHAR(50)

  • Required: Yes

  • Description: Status | Error | Message.

@LogText
  • Type: NVARCHAR(4000)

  • Required: Yes

  • Description: Inputs/outputs/context of this step.

@LogStatus
  • Type: NVARCHAR(50)

  • Required: Yes

  • Description: Start | In Progress | Done.

@StartTime
  • Type: DATETIME

  • Required: No (default = GETUTCDATE())

  • Description: UTC start time for calculating duration.

@MFTableName
  • Type: NVARCHAR(128)

  • Required: No

  • Description: Class table name (e.g., ‘MFCustomer’).

@Validation_ID
  • Type: INT

  • Required: No

  • Description: External validation table ID, if used.

@ColumnName
  • Type: NVARCHAR(128)

  • Required: No

  • Description: Column name related to ColumnValue.

@ColumnValue
  • Type: NVARCHAR(256)

  • Required: No

  • Description: Value such as counts or error text.

@Update_ID
  • Type: INT

  • Required: No

  • Description: Update identifier from calling procedure.

@LogProcedureName
  • Type: NVARCHAR(128)

  • Required: No

  • Description: Name of the calling procedure.

@LogProcedureStep
  • Type: NVARCHAR(128)

  • Required: No

  • Description: Description of the current step.

@ProcessBatchDetail_ID
  • Type: INT

  • Required: No (OUTPUT)

  • Description: When provided, used to derive StartTime and compute duration for the specific detail; otherwise returned as new ID.

@debug
  • Type: TINYINT

  • Required: No (default = 0)

  • Description: 1 = Standard debug; 101 = Advanced debug.

Purpose

Add a record to the MFProcessBatchDetail table. This procedure is executed for specific procedure steps.

Additional Info

The columns to be populated will depend on the nature of the sub procedure that is monitored.

Examples

SET @ProcedureStep = 'Prepare Table';
SET @LogTypeDetail = 'Status';
SET @LogStatusDetail = 'Start';
SET @LogTextDetail = 'For UpdateMethod ' + CAST(@UpdateMethod AS VARCHAR(10));
SET @LogColumnName = '';
SET @LogColumnValue = '';

EXECUTE @return_value = [dbo].[spMFProcessBatchDetail_Insert]
                              @ProcessBatch_ID = @ProcessBatch_ID
                            , @LogType = @LogTypeDetail
                            , @LogText = @LogTextDetail
                            , @LogStatus = @LogStatusDetail
                            , @StartTime = @StartTime
                            , @MFTableName = @MFTableName
                            , @Validation_ID = @Validation_ID
                            , @ColumnName = @LogColumnName
                            , @ColumnValue = @LogColumnValue
                            , @Update_ID = @Update_ID
                            , @LogProcedureName = @ProcedureName
                            , @LogProcedureStep = @ProcedureStep
                            , @ProcessBatchDetail_ID =   @ProcessBatchDetail_ID output
                            , @debug = @debug

Changelog

Date

Author

Description

2025-07-02

LC

Set to return processBatchDetail_ID

2022-01-04

LC

Add assembly logging for app detail logging

2020-03-12

LC

Improve default wording of text

2019-08-30

JC

Added documentation

2019-01-27

LC

Exclude MFUserMessage table from any logging

2018-10-31

LC

Update logging text

2017-06-30

AC

This will allow calculation of @DureationInSecords seconds on a detail proc level

2017-06-30

AC

Procedure will use input to overide the passed int StartDate and get start date from the ID provided

2017-06-30

AC

Add @ProcessBatchDetail_ID as param to allow for calculation of duration if provided based on input of a specific ID