dbo.CPL_TDComplianceRule
SQL_TRIGGER parent ComplianceRule
Created 2025-06-27T18:01:18.107 · 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 |
|---|---|---|---|
| BaseTree | OBJECT_OR_COLUMN | ||
| ComplianceRule | OBJECT_OR_COLUMN | ||
| deleted | OBJECT_OR_COLUMN | ||
| personInBaseTree | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Bulk | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YDBQueueRaw | TYPE | ||
| 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_TDComplianceRule on ComplianceRule for Delete not for Replication as begin if exists (select top 1 1 from deleted) goto start 2 return start: BEGIN TRY declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') declare @errno int declare @errmsg nvarchar(255 3) declare @UID_NonCompliance varchar(38) declare @whereclause nvarchar(1024) if exists (select top 1 1 from deleted r where r.IsInactive = 0 and r.IsWorkingCopy 4 = 0 ) begin raiserror( '#LDS#Enabled compliance rules cannot be deleted.|', 18, 3) with nowait end if exists (select top 1 1 from deleted r join personInBaseTree 5 pio on r.UID_NonCompliance = pio.uid_org and pio.XOrigin > 0 and r.IsWorkingCopy = 0 and r.IsInactive = 0 ) begin raiserror( '#LDS#Compliance rules cannot be deleted after disabling until there are no more violations.|' 6, 18, 3) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null 7, @GenProcID from ( select d.uid_ComplianceRule as uid from deleted d ) as x exec QBM_PDBQueueInsert_Bulk 'CPL-K-ComplianceCheckMakeProc', @DBQueueElements_01 8 update PersonInBaseTree set XOrigin = 0 where uid_org in (select d.UID_NonCompliance from deleted d where d.IsWorkingCopy = 0 ) delete PersonInBaseTree 9 where uid_org in (select d.UID_NonCompliance from deleted d where d.IsWorkingCopy = 0 ) delete BaseTree from BaseTree b join deleted d on b.UID_Org = 10d.UID_NonCompliance left outer join ComplianceRule r on d.UID_NonCompliance = r.UID_NonCompliance and r.UID_ComplianceRule <> d.UID_ComplianceRule where 11 r.UID_NonCompliance is null END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 12
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_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, UPDATE PersonInBaseTree, DELETE not, DELETE PersonInBaseTree, DELETE BaseTree; reads/joins deleted, personInBaseTree, BaseTree, ComplianceRule
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT into UPDATE PersonInBaseTree DELETE not DELETE PersonInBaseTree DELETE BaseTreeCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
CPL-K-ComplianceCheckMakeProcTemp tables / referenced variables
Temp: #LDS #Enabled #Compliance
Variables: @GenProcID @errno @errmsg @UID_NonCompliance @whereclause @DBQueueElements_01
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.