Back to OIM Explorer

dbo.TSB_PAfterMigrationJobCreate

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. References QBM_PJobCreate*

Source: sandbox-db sys.sql_modules

Source size: 1.687 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
  • Object-layer bridge detected through QBM_PJobCreate helper usage.

Relations

  • References QBM_PJobCreate*

Typed Edges

  • references source dbo.QBM_FTHexPattern source text reference
  • references source dbo.QBM_PJobCreate source text reference
  • references source dbo.QBM_PJobCreate_HOTemplate source text reference
  • references source dbo.QBM_PJobCreate_HOTemplate_B source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL73 lines
1CREATE PROCEDURE TSB_PAfterMigrationJobCreate(2  @GenProcID varchar(38)3)4AS5BEGIN6  DECLARE @MyModule varchar(3) = 'TSB'7  SET XACT_ABORT OFF8  BEGIN TRY9    DECLARE @CountElements int10    DECLARE @Puffer QBM_YCursorbuffer11    DECLARE @ElementCount int12    DECLARE @ElementIndex int13    DECLARE @ElementLast int14    DECLARE @SQL nvarchar(max)15    DECLARE @Parameters QBM_YParameterList16    INSERT INTO @Parameters(Parameter1,17    ContentFull)18    VALUES('SQLStmt',19    @SQL),20    ('WithoutTransaction',21    'True')22    SELECT @CountElements = count(*)23    FROM UNSAccountB u24    WHERE25      UID_Person IS NULL AND NeverConnectToPerson = 026    INSERT INTO @Puffer(ContentFull)27    SELECT28      CONCAT('exec QBM_PJobCreate_HOTemplate_B ''UNSAccountB'', ''UID_Person is null and NeverConnectToPerson = 0 and UID_UNSAccountB like '''''29      ,30      hp.HexPattern,31      ''''' '', @Columns = ''NeverConnectToPerson''',32      ',@GenProcID = ''',33      @Genprocid,34      '''',35      ', @AdditionalObjectKeysAffected = default')36    FROM dbo.QBM_FTHexPattern(CASE37    WHEN @CountElements > 20000000 THEN38    339    WHEN @CountElements > 3000000 THEN40    241    ELSE 142    END) AS hp43    SELECT @ElementCount = @@ROWCOUNT44    SELECT @ElementIndex = @@IDENTITY - @ElementCount +145    SELECT @ElementLast = @@IDENTITY46    WHILE @ElementIndex <= @ElementLast47    BEGIN48      SELECT TOP 1 @SQL = bu.ContentFull49      FROM @Puffer bu50      WHERE51        bu.ElementIndex = @ElementIndex52      UPDATE @Parameters53      SET ContentFull = @SQL54      WHERE55        Parameter1 = 'SQLStmt'56      EXEC QBM_PJobCreate 'VI.JobService.JobComponents.SQLComponent',57      'Execute SQL',58        @Parameters = @Parameters,59        @GenProcID = @Genprocid,60        @ObjectKeysAffected = DEFAULT61      SELECT @ElementIndex += 162    END63  END TRY64  BEGIN CATCH65    EXEC QBM_PSessionErrorAdd DEFAULT66    RAISERROR('',67    18,68    1)69      WITH NOWAIT70  END CATCH71  endLabel:72  RETURN73END
Open raw exported source
SQL ยท Raw12 lines
1  create   procedure TSB_PAfterMigrationJobCreate (@GenProcID varchar(38) ) as begin declare @MyModule varchar(3) = 'TSB' SET XACT_ABORT OFF BEGIN2 TRY declare @CountElements int declare @Puffer QBM_YCursorbuffer declare @ElementCount int declare @ElementIndex int declare @ElementLast int declare 3@SQL nvarchar(max) declare @Parameters QBM_YParameterList  insert into @Parameters (Parameter1, ContentFull) values ('SQLStmt', @SQL) , ('WithoutTransaction'4, 'True')  select @CountElements = count(*) from UNSAccountB u where UID_Person is null and NeverConnectToPerson = 0 insert into @Puffer(ContentFull) select5 concat('exec QBM_PJobCreate_HOTemplate_B ''UNSAccountB'', ''UID_Person is null and NeverConnectToPerson = 0 and UID_UNSAccountB like ''''', hp.HexPattern6, ''''' '', @Columns = ''NeverConnectToPerson''' , ',@GenProcID = ''', @Genprocid, '''' , ', @AdditionalObjectKeysAffected = default' ) from dbo.QBM_FTHexPattern7( case when @CountElements > 20000000 then 3  when @CountElements > 3000000 then 2  else 1 end ) as hp select @ElementCount = @@ROWCOUNT select @ElementIndex8 = @@IDENTITY - @ElementCount +1 select @ElementLast = @@IDENTITY while @ElementIndex <= @ElementLast begin select top 1 @SQL = bu.ContentFull from @Puffer9 bu where bu.ElementIndex = @ElementIndex update @Parameters set ContentFull = @SQL where Parameter1 = 'SQLStmt' exec QBM_PJobCreate 'VI.JobService.JobComponents.SQLComponent'10 , 'Execute SQL' , @Parameters = @Parameters , @GenProcID = @Genprocid , @ObjectKeysAffected = default select @ElementIndex += 1 end  END TRY BEGIN CATCH11 exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: return end 12