dbo.QER_TUOrgType
SQL_TRIGGER parent OrgType
Created 2025-06-27T18:01:08.150 · modified 2026-04-14T23:23:08.423 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| BaseTree | OBJECT_OR_COLUMN | ||
| deleted | OBJECT_OR_COLUMN | ||
| inserted | OBJECT_OR_COLUMN | ||
| OrgRoot | OBJECT_OR_COLUMN | ||
| OrgType | OBJECT_OR_COLUMN | ||
| PersonInBaseTree | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGISessionContext | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create trigger QER_TUOrgType on OrgType for UPDATE not for Replication as begin BEGIN TRY if exists (select top 1 1 from inserted) goto 2start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') 3 if update (IsPersonAssignOnce) begin if exists (select top 1 1 from OrgType t join deleted d on t.UID_OrgType = d.UID_OrgType where t.IsPersonAssignOnce 4 = 1 and exists (select top 1 1 from PersonInBaseTree pib join BaseTree b on pib.UID_Org = b.UID_Org join OrgRoot r on b.UID_OrgRoot = r.UID_OrgRoot and 5 r.UID_OrgType = t.UID_OrgType group by pib.UID_Person having count(*) > 1 ) ) begin raiserror( '#LDS#IsPersonAssignOnce cannot be set, because at least one person is assigned to a role class in this role type more than once.|' 6, 18, 2) with nowait end end if update (IsPersonAssignOnce) begin if exists (select top 1 1 from OrgType t join deleted d on t.UID_OrgType = d.UID_OrgType 7 where t.IsPersonAssignOnce = 1 and exists (select top 1 1 from PersonInBaseTree pib join BaseTree b on pib.UID_Org = b.UID_Org where b.UID_OrgType = t.UID_OrgType 8 group by pib.UID_Person having count(*) > 1 ) ) begin raiserror( '#LDS#IsPersonAssignOnce cannot be set, because at least one person is assigned to roles in this role type more than once.|' 9, 18, 2) with nowait end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 10
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:23:08.423
uses session context values has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; writes UPDATE not; reads/joins inserted, deleted, OrgType, PersonInBaseTree, BaseTree…
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
UPDATE notCalled routines
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #LDS #IsPersonAssignOnce
Variables: @GenProcID
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.