dbo.QER_PPickedItemInsertRandom
SQL_STORED_PROCEDURE
Created 2025-06-27T18:01:07.620 · modified 2026-04-14T23:20:40.457 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@UID_QERPickCategory | varchar | no |
@TableName | varchar | no |
@PickRate | float | no |
@WhereClause | nvarchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YParameterList | TYPE | ||
| QER_PPickedItemInsert_b | OBJECT_OR_COLUMN | ||
| QERPickedItem | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVDatetimeToString | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVFloatToString | 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 QER_PPickedItemInsertRandom (@UID_QERPickCategory varchar(38) , @TableName varchar(30) , @PickRate float , @WhereClause nvarchar 2(max) = '1=1' ) as begin declare @heute varchar(32) = dbo.QBM_FCVDatetimeToString(getutcdate()) declare @Anteil int declare @Items QBM_YParameterList declare 3 @SQLCmd nvarchar(max) declare @Columns QBM_YParameterList Declare @ColumnString nvarchar(256) declare @DebugSwitch int = 0 SET XACT_ABORT OFF BEGIN TRY 4 if not @PickRate between 0.0 and 100.0 begin raiserror ('#LDS#PickRate has to be percentage in range [0..100].|', 18,1) with nowait end select @Anteil 5 = convert(int, @PickRate * 10000.0) /100 delete QERPickedItem where UID_QERPickCategory = @UID_QERPickCategory select @SQLCmd = CONCAT(' 6select y.XObjectKey 7 from ( 8 select x.XObjectKey, ROW_NUMBER() over(order by x.HashValue) as Zeile, x.HashValue, x.GesamtZahl, convert(int, x.GesamtZahl * ' 9, dbo.QBM_FCVFloatToString( @PickRate) , ' / 100.0) as MaxZeile 10 from ( 11 select 12 /*', @TableName , '.UID_Person -- nur für debugging 13 , */ ' 14, @TableName , '.XObjectKey 15 , dbo.QBM_FCVAnyToHash(CONCAT(', @TableName , '.XObjectKey, ''', @heute ,''')) as HashValue 16 , convert(float, COUNT(*) over()) as GesamtZahl 17 from ' 18, @TableName , ' 19 -- evtl. Einschränkungen 20 where (', @WhereClause , ') 21 -- evtl. Einschränkungen 22 ) as x 23 ) as y 24 where y.Zeile <= y.MaxZeile 25' 26 ) if @DebugSwitch > 0 begin print @SQLcmd end insert into @Items(Parameter1) exec sp_executesql @SQLcmd exec QER_PPickedItemInsert_b @UID_QERPickCategory 27, @Items END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18 28, 1) WITH NOWAIT END CATCH endLabel: return end 29
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:40.457
has TRY/CATCH error handling
Summary: calls QER_PPickedItemInsert_b, QBM_PSessionErrorAdd; writes INSERT into, DELETE QERPickedItem
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@UID_QERPickCategory | varchar(38) | input |
@TableName | varchar(30) | input |
@PickRate | float | input |
@WhereClause | nvarchar | input |
DML targets
INSERT into DELETE QERPickedItemCalled routines
Read/join references
None extracted.
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #LDS #PickRate
Variables: @UID_QERPickCategory @TableName @PickRate @WhereClause @heute @Anteil @Items @SQLCmd @Columns @ColumnString @DebugSwitch @SQLcmd @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.