dbo.QER_TIHardware
Database TriggerSQL_TRIGGERSandbox DB
Interpretation
- Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
- DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.
Relations
- Bulk DBQueue insert -> QER-K-HelperHardwareOrg / QER_ZHelperHardwareOrg at line 7
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: Hardware
Typed Edges
- queues DBQueue task QER_ZHelperHardwareOrg at line 7 Bulk DBQueue insert -> QER-K-HelperHardwareOrg / QER_ZHelperHardwareOrg at line 7
- trigger on table Hardware Trigger parent table: Hardware
- references source dbo.QBM_FGIColumnUpdatedOthers source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
Complete Source
1CREATE trigger QER_TIHardware2 ON Hardware FOR3INSERT NOT FOR Replication4AS5BEGIN6 BEGIN TRY7 IF EXISTS(8 SELECT TOP 1 19 FROM inserted)10 GOTO start11 RETURN start:12 DECLARE @GenProcID varchar(38)13 SELECT @GenProcID = dbo.QBM_FGISessionContext('')14 IF EXISTS(15 SELECT TOP 1 116 FROM inserted i17 JOIN Hardwaretype p18 ON i.UID_Hardwaretype = p.UID_Hardwaretype AND p.isInactive = 1)19 BEGIN20 RAISERROR('#LDS#Assignment cannot take place, because the device type is disabled.|',21 18,22 2)23 WITH nowait24 END25 IF dbo.QBM_FGIColumnUpdatedOthers('Hardware',26 'XTouched',27 columns_updated()) = 128 BEGIN29 DECLARE @maxAnzahl int30 SELECT @maxAnzahl = 10031 IF 100 <(32 SELECT count(*)33 FROM inserted)34 BEGIN35 SELECT TOP 1 @maxAnzahl =((Count(*)) /10 + 1)36 FROM Hardware37 END38 ELSE39 BEGIN40 SELECT @maxAnzahl = 107374182441 END42 END43 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw44 INSERT INTO @DBQueueElements_02(object,45 subobject,46 genprocid)47 SELECT48 x.uid,49 NULL,50 @GenProcID51 FROM(52 SELECT inserted.uid_Hardware AS uid53 FROM inserted) AS x54 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-HelperHardwareOrg',55 @DBQueueElements_0256 END TRY57 BEGIN CATCH58 EXEC QBM_PSessionErrorAdd DEFAULT59 RAISERROR('',60 18,61 1)62 WITH NOWAIT63 END CATCH64 ende:65 RETURN66END
Open raw exported source
1 create trigger QER_TIHardware on Hardware for Insert not for Replication as begin BEGIN TRY if exists (select top 1 1 from inserted) goto2 start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if exists(select top 1 1 from inserted i join Hardwaretype3 p on i.UID_Hardwaretype = p.UID_Hardwaretype and p.isInactive = 1 ) begin raiserror( '#LDS#Assignment cannot take place, because the device type is disabled.|'4, 18, 2) with nowait end if dbo.QBM_FGIColumnUpdatedOthers ('Hardware', 'XTouched', columns_updated()) = 1 begin declare @maxAnzahl int select @maxAnzahl5 = 100 if 100 < (select count(*) from inserted) begin select top 1 @maxAnzahl = ( (Count(*)) /10 + 1) from Hardware end else begin select @maxAnzahl = 61073741824 end end declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID7 from ( select inserted.uid_Hardware as uid from inserted ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-HelperHardwareOrg', @DBQueueElements_02 END TRY 8BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 9