Back to OIM Explorer

dbo.QBM_PTDialogScheduleReferences

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 1.326 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_FGISessionErrorRethrow source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL50 lines
1CREATE PROCEDURE QBM_PTDialogScheduleReferences(2  @UID_DialogSchedule varchar(38)3)4AS5BEGIN6  DECLARE @Cmd nvarchar(max) = ''7  DECLARE @DebugSwitch int = 08  SET XACT_ABORT OFF9  BEGIN TRY10    SELECT11      @cmd = string_agg(convert(nvarchar(max), CASE r.IsMNRelation12      WHEN 0 THEN13      N 'select ''' + r.ChildTable + ''' as ReferencedTable, ''' + r.ChildColumn + ''' as ReferencedColumn 14				, x.XObjectKey as ReferencedElement15				from '16      + r.ChildTable + '  x17				where ' + r.ChildColumn + ' = ''' + @UID_DialogSchedule + '''18			'19    ELSE N 'select ''' + r.ChildTable + ''' as ReferencedTable, ''' + r.ChildColumn + ''' as ReferencedColumn 20				, y.XObjectKey as ReferencedElement21				from '22    + r.childtable + ' x join ' + mn.Parenttable + ' y on x.' + mn.childcolumn + '  = y.' + mn.parentcolumn + '23				where ' + r.ChildColumn + ' = '''24    + @UID_DialogSchedule + '''25			'26    END),27    CONCAT(N '			union all ', nchar(13), nchar(10)))28    FROM QBM_VQBMRelation r29    LEFT30    OUTER31    JOIN QBM_VQBMRelation mn32      ON r.UID_QBMRelationMN = mn.UID_QBMRelation33    WHERE34      r.ParentTable = 'DialogSchedule'35    IF @DebugSwitch > 036    BEGIN37      print @cmd38    END39  END TRY40  BEGIN CATCH41    EXEC QBM_PSessionErrorAdd DEFAULT42    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()43    RAISERROR(@Rethrow,44    18,45    1)46      WITH NOWAIT47  END CATCH48  endLabel:49  EXEC sp_executesql @cmd50END
Open raw exported source
SQL ยท Raw18 lines
1    create   procedure QBM_PTDialogScheduleReferences (@UID_DialogSchedule varchar(38) ) as begin declare @Cmd nvarchar(max) = '' declare @DebugSwitch2 int = 0 SET XACT_ABORT OFF BEGIN TRY select @cmd = string_agg(convert(nvarchar(max), case r.IsMNRelation when 0 then N'select ''' + r.ChildTable + ''' as ReferencedTable, '''3 + r.ChildColumn + ''' as ReferencedColumn 4				, x.XObjectKey as ReferencedElement5				from ' + r.ChildTable + '  x6				where ' + r.ChildColumn + ' = '''7 + @UID_DialogSchedule + '''8			' else N'select ''' + r.ChildTable + ''' as ReferencedTable, ''' + r.ChildColumn + ''' as ReferencedColumn 9				, y.XObjectKey as ReferencedElement10				from '11 + r.childtable + ' x join ' + mn.Parenttable + ' y on x.' + mn.childcolumn + '  = y.' + mn.parentcolumn + '12				where ' + r.ChildColumn + ' = ''' + @UID_DialogSchedule13 + '''14			' end )  , concat(N'			union all ', nchar(13), nchar(10)) )  from QBM_VQBMRelation r left outer join QBM_VQBMRelation mn on r.UID_QBMRelationMN15 = mn.UID_QBMRelation where r.ParentTable = 'DialogSchedule' if @DebugSwitch > 0 begin print @cmd end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default16 declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: exec sp_executesql @cmd 17end 18