Back to OIM Explorer

dbo.QBM_ZPrePropColumnFK

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure. Bulk DBQueue insert -> QBM-K-CommonPrepropColumnFK / QBM_ZPrePropColumnFK at line 19; Bulk DBQueue insert -> QBM-K-CommonPrepropTableFK / QBM_ZPreProptableFK at line 19; Bulk DBQueue insert -> QBM-K-CommonPrepropTableFK / QBM_ZPreProptableFK at line 22; References QBM_PDBQueueInsert_Bulk

Source: sandbox-db sys.sql_modules

Source size: 3.639 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
  • DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.

Relations

  • Bulk DBQueue insert -> QBM-K-CommonPrepropColumnFK / QBM_ZPrePropColumnFK at line 19
  • Bulk DBQueue insert -> QBM-K-CommonPrepropTableFK / QBM_ZPreProptableFK at line 19
  • Bulk DBQueue insert -> QBM-K-CommonPrepropTableFK / QBM_ZPreProptableFK at line 22
  • References QBM_PDBQueueInsert_Bulk

Typed Edges

  • queues DBQueue task QBM_ZPrePropColumnFK at line 19 Bulk DBQueue insert -> QBM-K-CommonPrepropColumnFK / QBM_ZPrePropColumnFK at line 19
  • queues DBQueue task QBM_ZPreProptableFK at line 19 Bulk DBQueue insert -> QBM-K-CommonPrepropTableFK / QBM_ZPreProptableFK at line 19
  • queues DBQueue task QBM_ZPreProptableFK at line 22 Bulk DBQueue insert -> QBM-K-CommonPrepropTableFK / QBM_ZPreProptableFK at line 22
  • references source dbo.QBM_FGIPrepropConditionDeactiv source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionContextSet source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_ZPrePropColumn source text reference
  • queues DBQueue task QBM-K-CommonPrepropColumnFK -> QBM_ZPrePropColumnFK QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropColumnFK', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from (select distinct t.Ta…
  • queues DBQueue task QBM-K-CommonPrepropTableFK -> QBM_ZPreProptableFK QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropTableFK', @DBQueueElements_02 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R…

Complete Source

SQL149 lines
1CREATE PROCEDURE QBM_ZPrePropColumnFK(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @CountItems int8  DECLARE @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('')9  DECLARE @DBQueueCurrent QBM_YDBQueueCurrent10  DECLARE @XUser nvarchar(64) = object_name(@@procid)11  DECLARE @Xdate datetime = getutcdate()12  BEGIN TRY13    INSERT INTO @DBQueueCurrent(UID_DialogDBQueue,14    UID_Parameter,15    UID_SubParameter,16    GenProcID)17    SELECT18      UID_DialogDBQueue,19      UID_Parameter,20      UID_SubParameter,21      GenProcID22    FROM QBMDBQueueCurrent cu23      WITH(readpast)24    WHERE25      cu.SlotNumber = @SlotNumber26    IF @@rowcount = 027    BEGIN28      GOTO EndLabel29    END30    DECLARE @PrePropHelper QBM_YPrepropHelper31    INSERT INTO @PrePropHelper(uid_parameter,32    isDeactivatedPrior,33    IsDeactivated,34    IsDeactivatedOld,35    GenProcID,36    PreProcessorCondition,37    PreProcessorConditionT)38    SELECT39      x.uid_parameter,40      0,41      0,42      isnull(c.isDeactivatedByPreProcessor,43      0),44      x.GenProcID,45      isnull(c.PreProcessorCondition,46      N ''),47      isnull(t.PreProcessorCondition,48      N '')49    FROM @DBQueueCurrent x50    JOIN dialogcolumn c51      ON x.uid_parameter = c.uid_dialogcolumn52    JOIN dialogtable t53      ON c.UID_DialogTable = t.UID_DialogTable54    SELECT @GenProcID = max(GenProcID)55    FROM @DBQueueCurrent56    UPDATE @PrePropHelper57    SET isDeactivated = isnull(c.isDeactivatedByPreProcessor,58    0)59    FROM @PrePropHelper h60    JOIN QBMRelation r61      ON r.UID_ChildColumn = h.uid_parameter62    JOIN DialogColumn c63      ON r.UID_ParentColumn = c.UID_DialogColumn64    WHERE65      h.isDeactivated <> isnull(c.isDeactivatedByPreProcessor,66    0)67    UPDATE @PrePropHelper68    SET IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorConditionT)69    FROM @PrePropHelper h70    WHERE71      h.PreProcessorCondition > ' ' AND h.IsDeactivated = 072    UPDATE @PrePropHelper73    SET IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorCondition)74    FROM @PrePropHelper h75    WHERE76      h.PreProcessorCondition > ' ' AND h.IsDeactivated = 077    UPDATE @preprophelper78    SET IsDeactivated = 179    FROM @preprophelper h,80    dialogcolumn c,81    dialogcolumn b82    WHERE83      h.uid_parameter = c.uid_dialogcolumn AND c.uid_BaseColumn = b.uid_dialogColumn AND b.isDeactivatedByPreprocessor = 184    EXEC QBM_PSessionContextSet 'GenProcID',85      @GenProcID86    UPDATE DialogColumn87    SET IsDeactivatedByPreProcessor = x.isDeactivated,88    XDateUpdated = @Xdate,89    XUserUpdated = @XUser90    FROM DialogColumn r91    JOIN @PrePropHelper x92      ON r.UID_DialogColumn = x.uid_parameter93    WHERE94      r.IsDeactivatedByPreProcessor <> x.IsDeactivated95    SELECT @CountItems = @@rowcount96    IF @CountItems > 097    BEGIN98      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw99      INSERT INTO @DBQueueElements_01(object,100      subobject,101      genprocid)102      SELECT103        x.uid,104        NULL,105        @GenProcID106      FROM(107      SELECT108        DISTINCT cv.UID_DialogColumn AS UID109      FROM DialogColumn c110      JOIN @PrePropHelper x111        ON c.uid_dialogColumn = x.uid_parameter AND c.ispkmember = 1 AND x.IsDeactivated <> x.IsDeactivatedOld112      JOIN DialogColumn cv113        WITH(nolock)114        ON cv.uid_BaseColumn = c.uid_dialogColumn) AS x115      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropColumnFK',116        @DBQueueElements_01117      DECLARE @DBQueueElements_02 QBM_YDBQueueRaw118      INSERT INTO @DBQueueElements_02(object,119      subobject,120      genprocid)121      SELECT122        x.uid,123        NULL,124        @GenProcID125      FROM(126      SELECT127        DISTINCT t.TableName AS UID128      FROM DialogColumn c129      JOIN @PrePropHelper x130        ON c.uid_dialogColumn = x.uid_parameter AND c.ispkmember = 1 AND x.IsDeactivated <> x.IsDeactivatedOld131      JOIN DialogTable t132        WITH(nolock)133        ON c.UID_DialogTable = t.UID_DialogTable) AS x134      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropTableFK',135        @DBQueueElements_02136    END137  END TRY138  BEGIN CATCH139    EXEC QBM_PSessionErrorAdd DEFAULT140    RAISERROR('',141    18,142    1)143      WITH NOWAIT144  END CATCH145  endLabel:146  EXEC QBM_PSessionContextSet 'GenProcID',147    @GenProcID_R148  RETURN149END
Open raw exported source
SQL · Raw24 lines
1   create   procedure QBM_ZPrePropColumnFK (@SlotNumber int) as begin  declare @GenProcID varchar(38) declare @CountItems int  declare @GenProcID_R2 varchar(38) = dbo.QBM_FGISessionContext('') declare @DBQueueCurrent QBM_YDBQueueCurrent declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate3 datetime = getutcdate() BEGIN TRY insert into @DBQueueCurrent(UID_DialogDBQueue, UID_Parameter, UID_SubParameter, GenProcID) select UID_DialogDBQueue,4 UID_Parameter, UID_SubParameter, GenProcID from QBMDBQueueCurrent cu with (readpast) where cu.SlotNumber = @SlotNumber if @@rowcount = 0 begin goto EndLabel5 end declare @PrePropHelper QBM_YPrepropHelper insert into @PrePropHelper (uid_parameter , isDeactivatedPrior , IsDeactivated , IsDeactivatedOld, GenProcID6 , PreProcessorCondition, PreProcessorConditionT) select x.uid_parameter, 0, 0, isnull(c.isDeactivatedByPreProcessor,0), x.GenProcID, isnull(c.PreProcessorCondition7,N''), isnull(t.PreProcessorCondition,N'') from @DBQueueCurrent x join dialogcolumn c on x.uid_parameter = c.uid_dialogcolumn join dialogtable t on c.UID_DialogTable8 = t.UID_DialogTable   select @GenProcID = max(GenProcID) from @DBQueueCurrent    update @PrePropHelper set isDeactivated = isnull(c.isDeactivatedByPreProcessor9,0) from @PrePropHelper h join QBMRelation r on r.UID_ChildColumn = h.uid_parameter join DialogColumn c on r.UID_ParentColumn = c.UID_DialogColumn where10 h.isDeactivated <> isnull(c.isDeactivatedByPreProcessor,0)   update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv(h.PreProcessorConditionT11) from @PrePropHelper h where h.PreProcessorCondition > ' ' and h.IsDeactivated = 0   update @PrePropHelper set IsDeactivated = dbo.QBM_FGIPrepropConditionDeactiv12(h.PreProcessorCondition) from @PrePropHelper h where h.PreProcessorCondition > ' ' and h.IsDeactivated = 0  update @preprophelper set IsDeactivated = 131 from @preprophelper h, dialogcolumn c, dialogcolumn b where h.uid_parameter = c.uid_dialogcolumn and c.uid_BaseColumn = b.uid_dialogColumn and b.isDeactivatedByPreprocessor14 = 1    exec QBM_PSessionContextSet 'GenProcID', @GenProcID update DialogColumn set IsDeactivatedByPreProcessor = x.isDeactivated , XDateUpdated = @Xdate15 , XUserUpdated = @XUser  from DialogColumn r join @PrePropHelper x on r.UID_DialogColumn = x.uid_parameter where r.IsDeactivatedByPreProcessor <> x.IsDeactivated16 select @CountItems = @@rowcount   if @CountItems > 0 begin  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject17, genprocid) select x.uid, null, @GenProcID from (select distinct cv.UID_DialogColumn as UID from DialogColumn c join @PrePropHelper x on c.uid_dialogColumn18 = x.uid_parameter and c.ispkmember = 1 and x.IsDeactivated <> x.IsDeactivatedOld join DialogColumn cv with (nolock) on cv.uid_BaseColumn = c.uid_dialogColumn19 ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropColumnFK', @DBQueueElements_01  declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_0220 (object, subobject, genprocid) select x.uid, null, @GenProcID from (select distinct t.TableName as UID from DialogColumn c join @PrePropHelper x on c.uid_dialogColumn21 = x.uid_parameter and c.ispkmember = 1 and x.IsDeactivated <> x.IsDeactivatedOld join DialogTable t with (nolock) on c.UID_DialogTable = t.UID_DialogTable22 ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropTableFK', @DBQueueElements_02 end   END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR23 ('', 18, 1) WITH NOWAIT END CATCH  endLabel: exec QBM_PSessionContextSet 'GenProcID', @GenProcID_R return end 24