dbo.CPL_PRuleCompareWorkForReport
SQL_STORED_PROCEDURE
Created 2025-06-27T18:01:18.063 · modified 2026-04-14T23:20:45.877 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@UID_ComplianceRuleWork | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| ComplianceRule | OBJECT_OR_COLUMN | ||
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | 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 CPL_PRuleCompareWorkForReport(@UID_ComplianceRuleWork varchar(38) ) as begin declare @whereOld nvarchar(max) = '1 = 0' declare 2 @whereNew nvarchar(max) = '1 = 0' declare @selectList nvarchar(1000) = 'select Internalname, DefaultEmailAddress as Mail, Phone, UID_Locality, UID_Department, UID_ProfitCenter, ' 3 declare @DebugSwitch int = 0 declare @SQLcmd nvarchar(max) SET XACT_ABORT OFF BEGIN TRY select top 1 @whereOld = isnull(r.whereclause, '1 = 0') , @whereNew 4 = isnull(w.whereclause, '1 = 0') from ComplianceRule r join ComplianceRule w on w.UID_ComplianceRule = r.UID_ComplianceRuleWork where w.uid_compliancerule 5 = @UID_ComplianceRuleWork select @SQLcmd = 'select x.Internalname, x.Mail, x.Phone, p.Shortname as ProfitCenter, d.Departmentname as Department, l.Ident_locality as Locality, x.Comparison 6 from (' 7 + @selectList + '''EQUAL'' as Comparison, 3 as SortOrder 8 from person 9 where (' + @whereOld + ') 10 and (' + @whereNew + ') 11 12 union all 13 14 ' 15 + @selectList + '''DEL'', 2 16 from person 17 where (' + @whereOld + ') 18 and not (' + @whereNew + ') 19 20 union all 21 22 ' + @selectList 23 + '''NEW'', 1 24 from person 25 where not (' + @whereOld + ') 26 and (' + @whereNew + ') 27 ) as x left outer join department d on d.uid_department = x.uid_department 28 left outer join locality l on l.uid_locality = x.uid_locality 29 left outer join ProfitCenter p on p.uid_ProfitCenter = x.uid_ProfitCenter 30 order by x.SortOrder, x.Internalname' 31 if @DebugSwitch > 0 begin print @sqlcmd end exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLcmd , @LockTimeout_ms = default , @MaxWaitTimeForLock_s 32 = default , @ProcIDForJournal = @@procid , @HandleErrorSilent = 0 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) 33 = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: end 34
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:45.877
has TRY/CATCH error handling
Summary: calls QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; reads/joins ComplianceRule, person, department, locality, ProfitCenter
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@UID_ComplianceRuleWork | varchar(38) | input |
DML targets
None extracted.Called 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: @UID_ComplianceRuleWork @whereOld @whereNew @selectList @DebugSwitch @SQLcmd @sqlcmd @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @procid @HandleErrorSilent @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.