logs.usp_ExecutionLog_insert - P

type: P ( stored procedure ), modify_date: 2021-12-18 16:46:42

RepoObject_guid: 8B90291C-9D61-EB11-84DC-A81E8446D5B0

Description

Examples

Parameters

  • @execution_instance_guid (uniqueidentifier)

  • @ssis_execution_id (bigint)

  • @sub_execution_id (int)

  • @parent_execution_log_id (bigint)

  • @current_execution_guid (uniqueidentifier)

  • @proc_id (int)

  • @proc_schema_name (nvarchar(128))

  • @proc_name (nvarchar(128))

  • @event_info (nvarchar(max))

  • @step_id (int)

  • @step_name (nvarchar(1000))

  • @source_object (nvarchar(261))

  • @target_object (nvarchar(261))

  • @inserted (int)

  • @updated (int)

  • @deleted (int)

  • @info_01 (nvarchar(4000))

  • @info_02 (nvarchar(4000))

  • @info_03 (nvarchar(4000))

  • @info_04 (nvarchar(4000))

  • @info_05 (nvarchar(4000))

  • @info_06 (nvarchar(4000))

  • @info_07 (nvarchar(4000))

  • @info_08 (nvarchar(4000))

  • @info_09 (nvarchar(4000))

  • @parameter_01 (nvarchar(4000))

  • @parameter_02 (nvarchar(4000))

  • @parameter_03 (nvarchar(4000))

  • @parameter_04 (nvarchar(4000))

  • @parameter_05 (nvarchar(4000))

  • @parameter_06 (nvarchar(4000))

  • @parameter_07 (nvarchar(4000))

  • @parameter_08 (nvarchar(4000))

  • @parameter_09 (nvarchar(4000))

  • @parameter_10 (nvarchar(4000))

  • @parameter_11 (nvarchar(4000))

  • @parameter_12 (nvarchar(4000))

  • @parameter_13 (nvarchar(4000))

  • @parameter_14 (nvarchar(4000))

  • @parameter_15 (nvarchar(4000))

  • @parameter_16 (nvarchar(4000))

  • @parameter_17 (nvarchar(4000))

  • @parameter_18 (nvarchar(4000))

  • @parameter_19 (nvarchar(4000))

  • @parameter_20 (nvarchar(4000))

  • @execution_log_id (bigint)

Entity Diagram

entity-logs.usp_executionlog_insert

References

Referenced Objects

Referencing Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-logs.usp_executionlog_insert

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-logs.usp_executionlog_insert

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-logs.usp_executionlog_insert

sql_modules_definition

logs.usp_ExecutionLog_insert - P script
/*
only insert, no update

to get duration and grouping, use unique combinations of keys,for example

- @execution_instance_guid (which should be unique per execution)
- @ssis_execution_id
- @sub_execution_id
- @proc_id
- @step_id
- @parent_execution_log_id

if a procedure is called several times per ssis_execution, for example the @ssis_execution_id could be used as group and @execution_instance_guid for individual execution

it is also possible to use the @execution_log_id output parameter ad to store it back as @parent_execution_log_id

*/
CREATE Procedure logs.usp_ExecutionLog_insert
    @execution_instance_guid UniqueIdentifier
  , @ssis_execution_id       BigInt           = Null
  , @sub_execution_id        Int              = Null
  , @parent_execution_log_id BigInt           = Null
  , @current_execution_guid  UniqueIdentifier = Null
  , @proc_id                 Int              = Null
  , @proc_schema_name        NVarchar(128)    = Null
  , @proc_name               NVarchar(128)    = Null
  , @event_info              NVarchar(Max)    = Null
  , @step_id                 Int              = Null
  , @step_name               NVarchar(1000)   = Null
  , @source_object           NVarchar(261)    = Null
  , @target_object           NVarchar(261)    = Null
  , @inserted                Int              = Null
  , @updated                 Int              = Null
  , @deleted                 Int              = Null
  , @info_01                 NVarchar(4000)   = Null
  , @info_02                 NVarchar(4000)   = Null
  , @info_03                 NVarchar(4000)   = Null
  , @info_04                 NVarchar(4000)   = Null
  , @info_05                 NVarchar(4000)   = Null
  , @info_06                 NVarchar(4000)   = Null
  , @info_07                 NVarchar(4000)   = Null
  , @info_08                 NVarchar(4000)   = Null
  , @info_09                 NVarchar(4000)   = Null
  , @parameter_01            NVarchar(4000)   = Null
  , @parameter_02            NVarchar(4000)   = Null
  , @parameter_03            NVarchar(4000)   = Null
  , @parameter_04            NVarchar(4000)   = Null
  , @parameter_05            NVarchar(4000)   = Null
  , @parameter_06            NVarchar(4000)   = Null
  , @parameter_07            NVarchar(4000)   = Null
  , @parameter_08            NVarchar(4000)   = Null
  , @parameter_09            NVarchar(4000)   = Null
  , @parameter_10            NVarchar(4000)   = Null
  , @parameter_11            NVarchar(4000)   = Null
  , @parameter_12            NVarchar(4000)   = Null
  , @parameter_13            NVarchar(4000)   = Null
  , @parameter_14            NVarchar(4000)   = Null
  , @parameter_15            NVarchar(4000)   = Null
  , @parameter_16            NVarchar(4000)   = Null
  , @parameter_17            NVarchar(4000)   = Null
  , @parameter_18            NVarchar(4000)   = Null
  , @parameter_19            NVarchar(4000)   = Null
  , @parameter_20            NVarchar(4000)   = Null
  , @execution_log_id        BigInt           = Null Output
As
Declare @start_dt DateTime = GetDate ();

Insert Into logs.ExecutionLog
(
    execution_instance_guid
  , parent_execution_log_id
  , ssis_execution_id
  , sub_execution_id
  , current_execution_guid
  , proc_id
  , proc_schema_name
  , proc_name
  , event_info
  , step_id
  , step_name
  , created_dt
  , source_object
  , target_object
  , inserted
  , updated
  , deleted
  , info_01
  , info_02
  , info_03
  , info_04
  , info_05
  , info_06
  , info_07
  , info_08
  , info_09
  , parameter_01
  , parameter_02
  , parameter_03
  , parameter_04
  , parameter_05
  , parameter_06
  , parameter_07
  , parameter_08
  , parameter_09
  , parameter_10
  , parameter_11
  , parameter_12
  , parameter_13
  , parameter_14
  , parameter_15
  , parameter_16
  , parameter_17
  , parameter_18
  , parameter_19
  , parameter_20
)
Values
    (
        @execution_instance_guid
      , @parent_execution_log_id
      , @ssis_execution_id
      , @sub_execution_id
      , @current_execution_guid
      , @proc_id
      , @proc_schema_name
      , @proc_name
      , @event_info
      , @step_id
      , @step_name
      , @start_dt
      , @source_object
      , @target_object
      , @inserted
      , @updated
      , @deleted
      , Try_Cast(@info_01 As NVarchar(4000))
      , Try_Cast(@info_02 As NVarchar(4000))
      , Try_Cast(@info_03 As NVarchar(4000))
      , Try_Cast(@info_04 As NVarchar(4000))
      , Try_Cast(@info_05 As NVarchar(4000))
      , Try_Cast(@info_06 As NVarchar(4000))
      , Try_Cast(@info_07 As NVarchar(4000))
      , Try_Cast(@info_08 As NVarchar(4000))
      , Try_Cast(@info_09 As NVarchar(4000))
      , Try_Cast(@parameter_01 As NVarchar(4000))
      , Try_Cast(@parameter_02 As NVarchar(4000))
      , Try_Cast(@parameter_03 As NVarchar(4000))
      , Try_Cast(@parameter_04 As NVarchar(4000))
      , Try_Cast(@parameter_05 As NVarchar(4000))
      , Try_Cast(@parameter_06 As NVarchar(4000))
      , Try_Cast(@parameter_07 As NVarchar(4000))
      , Try_Cast(@parameter_08 As NVarchar(4000))
      , Try_Cast(@parameter_09 As NVarchar(4000))
      , Try_Cast(@parameter_10 As NVarchar(4000))
      , Try_Cast(@parameter_11 As NVarchar(4000))
      , Try_Cast(@parameter_12 As NVarchar(4000))
      , Try_Cast(@parameter_13 As NVarchar(4000))
      , Try_Cast(@parameter_14 As NVarchar(4000))
      , Try_Cast(@parameter_15 As NVarchar(4000))
      , Try_Cast(@parameter_16 As NVarchar(4000))
      , Try_Cast(@parameter_17 As NVarchar(4000))
      , Try_Cast(@parameter_18 As NVarchar(4000))
      , Try_Cast(@parameter_19 As NVarchar(4000))
      , Try_Cast(@parameter_20 As NVarchar(4000))
    );

Set @execution_log_id = Scope_Identity ();