dbo.QER_FGIReasonTypeForACCProduct
SQL_SCALAR_FUNCTION
Created 2025-06-27T18:01:06.807 · modified 2026-04-14T23:20:39.360 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| int | yes |
@UID_ACCProduct | varchar | no |
@TypeOfReasonType | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| AccProduct | OBJECT_OR_COLUMN | ||
| AccProductGroup | OBJECT_OR_COLUMN | ||
| AccProductGroupCollection | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create function dbo.QER_FGIReasonTypeForACCProduct(@UID_ACCProduct varchar(38) , @TypeOfReasonType varchar(16) ) returns int as begin return 2( select case @TypeOfReasonType when 'Approve' then x.ApproveReasonType when 'Deny' then x.DenyReasonType else x.OrderReasonType end from ( select case 3 y.ApproveReasonType when 3 then 2 else y.ApproveReasonType end as ApproveReasonType , case y.DenyReasonType when 3 then 2 else y.DenyReasonType end as 4 DenyReasonType , case y.OrderReasonType when 3 then 2 else y.OrderReasonType end as OrderReasonType from ( select max(a.ApproveReasonType) | max(isnull 5(ag.ApproveReasonType,0)) as ApproveReasonType , max(a.DenyReasonType) | max(isnull(ag.DenyReasonType,0)) as DenyReasonType , max(a.OrderReasonType) | 6max(isnull(ag.OrderReasonType,0)) as OrderReasonType from AccProduct a left outer join AccProductGroupCollection ac on a.UID_AccProductGroup = ac.UID_AccProductGroupChild 7 left outer join AccProductGroup ag on ac.UID_AccProductGroupParent = ag.UID_AccProductGroup where a.UID_AccProduct = @UID_ACCProduct ) as y ) as x ) end 8 9
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:39.360
None extracted.
Summary: reads/joins AccProduct, AccProductGroupCollection, AccProductGroup
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
| int | OUTPUT |
@UID_ACCProduct | varchar(38) | input |
@TypeOfReasonType | varchar(16) | input |
DML targets
None extracted.Called routines
None extracted.
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_ACCProduct @TypeOfReasonType
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.