Back to OIM Explorer

dbo.TSB_ZUNSGroupB2InUNSGroupB2_C

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.948 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.

Relations

  • No extracted relations.

Typed Edges

  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.TSB_ZUNSGroupB2InUNSGroupB2 source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL71 lines
1CREATE PROCEDURE TSB_ZUNSGroupB2InUNSGroupB2_C(2  @SlotNumberDummy int,3  @dummy1 varchar(38),4  @Dummy2 varchar(38),5  @GenProcIDDummy varchar(38)6)7AS8BEGIN9  BEGIN TRY10    UPDATE UNSGroupB2Collection11    SET IsCircular = 112    FROM UNSGroupB2Collection co13    WHERE14      co.UID_UNSGroupB2Child <> co.UID_UNSGroupB2Parent AND EXISTS(15    SELECT TOP 1 116    FROM UNSGroupB2Collection ce17    WHERE18      co.UID_UNSGroupB2Child = ce.UID_UNSGroupB2Parent AND co.UID_UNSGroupB2Parent = ce.UID_UNSGroupB2Child) AND IsCircular = 019    UPDATE UNSGroupB2Collection20    SET IsCircular = 021    FROM UNSGroupB2Collection co22    WHERE23      co.UID_UNSGroupB2Child <> co.UID_UNSGroupB2Parent AND NOT EXISTS(24    SELECT TOP 1 125    FROM UNSGroupB2Collection ce26    WHERE27      co.UID_UNSGroupB2Child = ce.UID_UNSGroupB2Parent AND co.UID_UNSGroupB2Parent = ce.UID_UNSGroupB2Child) AND IsCircular = 128    UPDATE UNSGroupB2Collection29    SET IsCircular = 130    FROM UNSGroupB2Collection co31    WHERE32      co.UID_UNSGroupB2Child = co.UID_UNSGroupB2Parent AND EXISTS(33    SELECT TOP 1 134    FROM UNSGroupB2Collection ce35    WHERE36      co.UID_UNSGroupB2Parent = ce.UID_UNSGroupB2Parent AND ce.UID_UNSGroupB2Child <> ce.UID_UNSGroupB2Parent AND IsCircular = 1) AND IsCircular37    = 038    UPDATE UNSGroupB2Collection39    SET IsCircular = 040    FROM UNSGroupB2Collection co41    WHERE42      co.UID_UNSGroupB2Child = co.UID_UNSGroupB2Parent AND NOT EXISTS(43    SELECT TOP 1 144    FROM UNSGroupB2Collection ce45    WHERE46      co.UID_UNSGroupB2Parent = ce.UID_UNSGroupB2Parent AND ce.UID_UNSGroupB2Child <> ce.UID_UNSGroupB2Parent AND IsCircular = 1) AND IsCircular47    = 148    UPDATE UNSGroupB2Collection49    SET IsCircular = x.IsCircular50    FROM UNSGroupB2Collection co51    JOIN(52    SELECT53      y.UID_UNSGroupB2Child,54      y.IsCircular55    FROM UNSGroupB2Collection y56    WHERE57      y.UID_UNSGroupB2Child = y.UID_UNSGroupB2Parent) AS x58      ON x.UID_UNSGroupB2Child = co.UID_UNSGroupB2Child59    WHERE60      co.IsCircular <> x.IsCircular61  END TRY62  BEGIN CATCH63    EXEC QBM_PSessionErrorAdd DEFAULT64    RAISERROR('',65    18,66    1)67      WITH NOWAIT68  END CATCH69  ende:70  RETURN71END
Open raw exported source
SQL ยท Raw14 lines
1         create   procedure TSB_ZUNSGroupB2InUNSGroupB2_C ( @SlotNumberDummy int , @dummy1 varchar(38) , @Dummy2 varchar(38) , @GenProcIDDummy2 varchar(38) ) as begin  BEGIN TRY update UNSGroupB2Collection set IsCircular = 1 from UNSGroupB2Collection co where co.UID_UNSGroupB2Child <> co.UID_UNSGroupB2Parent3 and exists (select top 1 1 from UNSGroupB2Collection ce where co.UID_UNSGroupB2Child = ce.UID_UNSGroupB2Parent and co.UID_UNSGroupB2Parent = ce.UID_UNSGroupB2Child4 ) and IsCircular = 0  update UNSGroupB2Collection set IsCircular = 0 from UNSGroupB2Collection co where co.UID_UNSGroupB2Child <> co.UID_UNSGroupB2Parent5 and not exists (select top 1 1 from UNSGroupB2Collection ce where co.UID_UNSGroupB2Child = ce.UID_UNSGroupB2Parent and co.UID_UNSGroupB2Parent6 = ce.UID_UNSGroupB2Child ) and IsCircular = 1  update UNSGroupB2Collection set IsCircular = 1 from UNSGroupB2Collection co where co.UID_UNSGroupB2Child7 = co.UID_UNSGroupB2Parent and exists (select top 1 1 from UNSGroupB2Collection ce where co.UID_UNSGroupB2Parent = ce.UID_UNSGroupB2Parent and 8ce.UID_UNSGroupB2Child <> ce.UID_UNSGroupB2Parent and IsCircular = 1 ) and IsCircular = 0 update UNSGroupB2Collection set IsCircular = 0 from UNSGroupB2Collection9 co where co.UID_UNSGroupB2Child = co.UID_UNSGroupB2Parent and not exists (select top 1 1 from UNSGroupB2Collection ce where co.UID_UNSGroupB2Parent10 = ce.UID_UNSGroupB2Parent and ce.UID_UNSGroupB2Child <> ce.UID_UNSGroupB2Parent and IsCircular = 1 ) and IsCircular = 1 update UNSGroupB2Collection11 set IsCircular = x.IsCircular from UNSGroupB2Collection co join (select y.UID_UNSGroupB2Child, y.IsCircular from UNSGroupB2Collection y where y.UID_UNSGroupB2Child12 = y.UID_UNSGroupB2Parent ) as x on x.UID_UNSGroupB2Child = co.UID_UNSGroupB2Child where co.IsCircular <> x.IsCircular  END TRY BEGIN CATCH exec 13QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  ende: return end 14