dbo.POL_PQERPolicyMakeProc

SQL_STORED_PROCEDURE

Created 2025-06-27T18:01:19.227 · modified 2026-04-14T23:20:46.087 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@uid_QERPolicyvarcharno
@Procnamevarcharno

Referenced objects

SchemaObjectColumn/minorClass
DialogTableOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_PSQLCreateOBJECT_OR_COLUMN
QERPolicyOBJECT_OR_COLUMN
dboQBM_FSQProcedureDefOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1         create   procedure POL_PQERPolicyMakeProc (@uid_QERPolicy varchar(38) , @Procname varchar(30) ) as begin declare @whereClause nvarchar(max
2) declare @Ident_QERPolicy nvarchar(64) declare @TableName nvarchar(32) declare @isToGrantEver bit  declare @PreInsert nvarchar(max) declare @PreDelete
3 nvarchar(max) declare @PostInsert nvarchar(max) declare @PostDelete nvarchar(max) declare @SQLcmdKomplett nvarchar(max) declare @ErrorMessage nvarchar
4(4000) declare @ErrorSeverity int declare @ErrorState int declare @DebugSwitch int = 0 declare @DebugLevel char(1) = 'W' SET XACT_ABORT OFF BEGIN TRY select
5 @whereClause = whereclause , @Ident_QERPolicy = replace(isnull(p.Ident_QERPolicy, N''), N'''', N'''''') , @TableName = t.TableName from QERPolicy p join
6 DialogTable t on t.UID_DialogTable = p.UID_DialogTable where p.UID_QERPolicy = @uid_QERPolicy if rtrim(isnull(@whereClause, N'') ) = N'' begin select 
7@whereClause = N'1=1' end   select @PreInsert = '
8truncate table #QBMDeltaInsert 
9
10insert into  #QBMDeltaInsert (Element, AssignedElement )
11  select '''
12 + rtrim(@UID_QERPolicy) + N''',  XObjectKey
13  from ' + @TableName + '
14  where Not exists (select top 1 1 from QERPolicyHasObject pho
15                     where pho.uid_QERPolicy = '''
16 + rtrim(@UID_QERPolicy) + N'''
17                     and pho.Objectkey = ' + @TableName + '.XObjectKey
18                   )
19    and (
20-- StartUserCondition 
21'
22  select @PostInsert = '
23-- EndUserCondition 
24      )
25' select @PreDelete = '
26truncate table #QBMDeltaDelete
27
28insert into  #QBMDeltaDelete (Element, AssignedElement )
29  select '''
30 + rtrim(@UID_QERPolicy) + ''', pho.ObjectKey
31  from QERPolicyHasObject pho 
32		left outer join ( select XObjectKey	
33							from  ' + @TableName + '  
34							where (
35								-- StartUserCondition 
36	'
37  select @PostDelete = '
38								-- EndUserCondition 
39									)
40						) as xxp on pho.ObjectKey = xxp.XObjectKey
41  where pho.uid_QERPolicy =  ''' 
42+ rtrim(@UID_QERPolicy) + N'''
43   and xxp.XObjectKey is null
44'  select @SQLcmdKomplett = dbo.QBM_FSQProcedureDef(@Procname, '', @Preinsert + @whereclause
45 + @Postinsert + @Predelete + @whereclause + @PostDelete , 'QERPolicy : ' + @Ident_QERPolicy + '(' + @uid_QERPolicy + ')' ) if @DebugSwitch > 0 begin print
46 @SQLcmdKomplett end exec QBM_PSQLCreate @Procname, 'P', @SQLcmdKomplett, @UnComment = 0 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR
47 ('', 18, 1) WITH NOWAIT END CATCH  return end 
48

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:46.087

has TRY/CATCH error handling

Summary: calls QBM_PSQLCreate, QBM_PSessionErrorAdd; writes INSERT into; reads/joins QERPolicy, DialogTable, QERPolicyHasObject

Declared parameters

ParameterTypeDirection
@uid_QERPolicyvarchar(38)input
@Procnamevarchar(30)input

DML targets

INSERT into

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: #QBMDeltaInsert #QBMDeltaDelete

Variables: @uid_QERPolicy @Procname @whereClause @Ident_QERPolicy @TableName @isToGrantEver @PreInsert @PreDelete @PostInsert @PostDelete @SQLcmdKomplett @ErrorMessage @ErrorSeverity @ErrorState @DebugSwitch @DebugLevel @UID_QERPolicy @Preinsert @whereclause @Postinsert @Predelete @UnComment

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.

Referencing objectRelationEvidence
dbo.POL_ZQERPolicyMakeProcSQL expression dependencyOBJECT_OR_COLUMN
dbo.POL_ZQERPolicyMakeProcsource text referencehas TRY/CATCH error handling