dbo.QBM_PQBMEventClean
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:29.810 · modified 2026-04-14T23:20:26.600 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| JobAutoStart | OBJECT_OR_COLUMN | ||
| JobEventGen | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBMEvent | OBJECT_OR_COLUMN | ||
| QBMEventHasFeature | OBJECT_OR_COLUMN | ||
| QBMModuleDef | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVElementToObjectKey2 | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVGUIDToModuleOwner | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create procedure QBM_PQBMEventClean as begin declare @DebugSwitch int = 0 declare @doppelte table (EventName nvarchar(64) collate database_default 2 , uid_dialogtable varchar(38) collate database_default , uid_QBMEventToUse varchar(38) collate database_default ) declare @XUser nvarchar(64) = object_name 3(@@procid) declare @Xdate datetime = getutcdate() SET XACT_ABORT OFF BEGIN TRY insert into @doppelte (EventName, uid_dialogtable, uid_QBMEventToUse) select 4 l.EventName, l.UID_DialogTable , substring(min(str( m.SortOrder) + l.UID_QBMEvent), 11,36) from QBMEvent l join ( select e.EventName, e.UID_DialogTable 5 from QBMEvent e group by e.EventName, e.UID_DialogTable having count(*) > 1 ) as d on l.EventName = d.EventName and l.UID_DialogTable = d.UID_DialogTable 6 join QBMModuleDef m on dbo.QBM_FCVGUIDToModuleOwner(l.UID_QBMEvent) = m.ModuleName group by l.EventName, l.UID_DialogTable if @DebugSwitch > 0 begin select 7 * from @doppelte end update JobEventGen set UID_QBMEvent = d.uid_QBMEventToUse , XDateUpdated = @Xdate , XUserUpdated = @XUser from JobEventGen g join 8 QBMEvent e on g.UID_QBMEvent = e.UID_QBMEvent join @doppelte d on d.EventName = e.EventName and d.uid_dialogtable = e.UID_DialogTable where g.UID_QBMEvent 9 <> d.uid_QBMEventToUse update JobAutoStart set UID_QBMEvent = d.uid_QBMEventToUse , XDateUpdated = @Xdate , XUserUpdated = @XUser from JobAutoStart g 10 join QBMEvent e on g.UID_QBMEvent = e.UID_QBMEvent join @doppelte d on d.EventName = e.EventName and d.uid_dialogtable = e.UID_DialogTable where g.UID_QBMEvent 11 <> d.uid_QBMEventToUse insert into QBMEventHasFeature (UID_QBMEvent, UID_DialogFeature, XObjectKey , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated 12 ) select d.uid_QBMEventToUse, g.UID_DialogFeature, dbo.QBM_FCVElementToObjectKey2 ('QBMEventHasFeature', 'UID_QBMEvent', d.uid_QBMEventToUse, 'UID_DialogFeature' 13, g.UID_DialogFeature) , g.XDateInserted, g.XDateUpdated, g.XUserInserted, g.XUserUpdated from QBMEventHasFeature g join QBMEvent e on g.UID_QBMEvent = 14 e.UID_QBMEvent join @doppelte d on d.EventName = e.EventName and d.uid_dialogtable = e.UID_DialogTable where g.UID_QBMEvent <> d.uid_QBMEventToUse and 15 not exists (select top 1 1 from QBMEventHasFeature x where x.UID_DialogFeature = g.UID_DialogFeature and x.UID_QBMEvent = d.uid_QBMEventToUse ) delete 16 QBMEventHasFeature from QBMEventHasFeature g join QBMEvent e on g.UID_QBMEvent = e.UID_QBMEvent join @doppelte d on d.EventName = e.EventName and d.uid_dialogtable 17 = e.UID_DialogTable where g.UID_QBMEvent <> d.uid_QBMEventToUse delete QBMEvent from QBMEvent e join @doppelte d on e.UID_DialogTable = d.uid_dialogtable 18 and e.EventName = d.EventName where e.UID_QBMEvent <> d.uid_QBMEventToUse END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar 19(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH ende: return end 20
Module relation graph
Loading module relation graph…
Source-derived context
Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.
provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:20:26.600
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; writes INSERT into, INSERT QBMEventHasFeature, UPDATE JobEventGen, UPDATE JobAutoStart, DELETE QBMEventHasFeature…; reads/joins QBMEvent, QBMModuleDef, JobEventGen, JobAutoStart, QBMEventHasFeature
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT into INSERT QBMEventHasFeature UPDATE JobEventGen UPDATE JobAutoStart DELETE QBMEventHasFeature DELETE QBMEventCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @DebugSwitch @doppelte @XUser @procid @Xdate @Rethrow
Referenced by / reverse dependencies
Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.
No reverse dependencies extracted.