dbo.CPL_TUComplianceRule
SQL_TRIGGER parent ComplianceRule
Created 2025-06-27T18:01:18.100 · modified 2026-04-14T23:23:08.017 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| ComplianceRule | OBJECT_OR_COLUMN | ||
| ComplianceSubrule | OBJECT_OR_COLUMN | ||
| deleted | OBJECT_OR_COLUMN | ||
| inserted | OBJECT_OR_COLUMN | ||
| PersonInBaseTree | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Bulk | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_PSQLCheckExecutable | OBJECT_OR_COLUMN | ||
| QBM_YDBQueueRaw | TYPE | ||
| QBM_YParameterList | TYPE | ||
| dbo | QBM_FGIBitPatternXOrigin | 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.
1create trigger CPL_TUComplianceRule on ComplianceRule for Update not for Replication as begin declare @SQLToCheck QBM_YParameterList declare 2 @CursorBuffer QBM_YParameterList declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() BEGIN TRY if exists (select 3 top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = 4dbo.QBM_FGISessionContext('') declare @errno int declare @errmsg nvarchar(255) declare @UID_NonCompliance varchar(38) declare @UID_ComplianceRule varchar 5(38) declare @WhereClause nvarchar(1024) if update(WhereClause) or update(WhereClausePerson) begin insert into @SQLToCheck(Parameter1, ContentFull) select 6 c.XObjectKey, 'select top 1 1 as columnvalue from ' + 'Person' + ' 7 where ( 8 ' + c.WhereClause + ' 9 )' from inserted c where c.WhereClause > 10 ' ' and c.IsSimpleMode = 0 insert into @SQLToCheck(Parameter1, ContentFull) select c.XObjectKey, 'select top 1 1 as columnvalue from ' + 'Person' + 11' 12 where ( 13 ' + c.WhereClausePerson + ' 14 )' from inserted c where c.WhereClausePerson > ' ' exec QBM_PSQLCheckExecutable @SQLToCheck, @RaiseError 15 = 1 end if update(WhereClausePerson) or update(IsInactive) or update(IsWorkingCopy) or update(IsPersonStoreInverted) begin declare @DBQueueElements_01 16 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select i.uid_ComplianceRule as uid 17 from inserted i ) as x exec QBM_PDBQueueInsert_Bulk 'CPL-K-ComplianceSubRuleFillPerson', @DBQueueElements_01 end if update(IsSimpleMode) or update(IsInactive 18) or update(IsWorkingCopy) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid 19, null, @GenProcID from ( select s.uid_ComplianceSubRule as uid from inserted i join ComplianceSubrule s on i.uid_complianceRule = s.uid_complianceRule 20 ) as x exec QBM_PDBQueueInsert_Bulk 'CPL-K-ComplianceSubRuleFillObject', @DBQueueElements_02 end if (update(WhereClause) or update(UID_NonCompliance) 21 or update(UID_OrgRuler) or update(IsExceptionAllowed) or update(RuleSeverity) or update(DetectRuleTypeForPWO) or update(isToGrantEver) or update(IsCrossPersonCheck 22) or update(IsSimpleMode) ) and ( update(IsInactive) or exists (select top 1 1 from inserted where isnull(IsInactive, 0) = 0 and isnull(IsWorkingCopy 23, 0) = 0 ) ) begin declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid) select x.uid, null, @GenProcID 24 from ( select t.UID_ComplianceRule as uid from ComplianceRule t join deleted d on t.UID_ComplianceRule = d.UID_ComplianceRule ) as x exec QBM_PDBQueueInsert_Bulk 25 'CPL-K-ComplianceCheckMakeProc', @DBQueueElements_03 end if (update(WhereClause) or update(IsInactive) or update(UID_NonCompliance) or update(IsExceptionAllowed 26) or update(DetectRuleTypeForPWO) or update(isToGrantEver) or update(IsCrossPersonCheck) or update(IsWorkingCopy) or update(IsCrossPersonCheck) or update 27(IsSimpleMode) ) begin declare @DBQueueElements_04 QBM_YDBQueueRaw insert into @DBQueueElements_04 (object, subobject, genprocid) select x.uid, null, @GenProcID 28 from ( select t.UID_ComplianceRule as uid from ComplianceRule t join deleted d on t.UID_ComplianceRule = d.UID_ComplianceRule ) as x exec QBM_PDBQueueInsert_Bulk 29 'CPL-K-ComplianceCheckMakeProc', @DBQueueElements_04 declare @DBQueueElements_05 QBM_YDBQueueRaw insert into @DBQueueElements_05 (object, subobject, 30genprocid) select x.uid, null, @GenProcID from ( select t.UID_ComplianceRule as uid from ComplianceRule t join deleted d on t.UID_ComplianceRule = d.UID_ComplianceRule 31 where isnull(t.IsInactive, 0) = 0 and isnull(t.IsWorkingCopy, 0) = 0 ) as x exec QBM_PDBQueueInsert_Bulk 'CPL-K-ComplianceCheckForRule', @DBQueueElements_05 32 end if update(UID_NonCompliance) or update(IsInActive) or update(IsWorkingCopy) begin update PersonInBaseTree set XOrigin = pio.XOrigin & dbo.QBM_FGIBitPatternXOrigin 33('|Dynamic|', 1) , XDateUpdated = @Xdate , XUserUpdated = @XUser from PersonInBaseTree pio join ( select distinct d.UID_NonCompliance from deleted d 34 join ComplianceRule r on d.uid_ComplianceRule = r.uid_ComplianceRule where isnull(d.UID_NonCompliance,'') <> isnull(r.UID_NonCompliance,'') or (isnull 35(d.IsInActive, 0) = 0 and isnull(r.IsInActive, 0) = 1) or (isnull(d.IsWorkingCopy, 0) = 0 and isnull(r.IsWorkingCopy, 0) = 1) ) as x on pio.UID_Org = x.UID_NonCompliance 36 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 37
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.017
inserts DBQueue tasks uses session context values has TRY/CATCH error handling
Summary: calls QBM_PSQLCheckExecutable, QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, UPDATE not, UPDATE PersonInBaseTree; reads/joins inserted, deleted, ComplianceSubrule, ComplianceRule, PersonInBaseTree
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT into UPDATE not UPDATE PersonInBaseTreeRead/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
CPL-K-ComplianceSubRuleFillPerson CPL-K-ComplianceSubRuleFillObject CPL-K-ComplianceCheckMakeProc CPL-K-ComplianceCheckForRuleTemp tables / referenced variables
Temp: None extracted.
Variables: @SQLToCheck @CursorBuffer @XUser @procid @Xdate @GenProcID @errno @errmsg @UID_NonCompliance @UID_ComplianceRule @WhereClause @RaiseError @DBQueueElements_01 @DBQueueElements_02 @DBQueueElements_03 @DBQueueElements_04 @DBQueueElements_05
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.