dbo.QBM_FTJobQueueSetSameServer

SQL_TABLE_VALUED_FUNCTION

Created 2026-04-14T23:20:31.850 · modified 2026-04-14T23:20:31.850 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@UID_Jobvarcharno

Referenced objects

SchemaObjectColumn/minorClass
dboJobQueueOBJECT_OR_COLUMN
dboJobQueueUID_JobOBJECT_OR_COLUMN
dboJobQueueUID_JobSameServerOBJECT_OR_COLUMN
dboJobQueueUID_TreeOBJECT_OR_COLUMN
dboJobQueueUID_JobErrorOBJECT_OR_COLUMN
dboJobQueueUID_JobSuccessOBJECT_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

1create function dbo.QBM_FTJobQueueSetSameServer (@UID_Job varchar(38) ) returns @erg table (UID_Job varchar(38) collate database_default , UID_JobSameServerOld
2 varchar(38) collate database_default , UID_JobSameServerNew varchar(38) collate database_default , UID_JobSuccess varchar(38) collate database_default
3 , UID_JobError varchar(38) collate database_default ) with schemabinding as begin  declare @UID_JobSameServerExists varchar(38) declare @UID_Tree varchar
4(38) declare @CountItems int if isnull(@UID_Job, '') = '' begin goto endLabel end select top 1 @UID_JobSameServerExists = uid_jobsameserver, @UID_Tree 
5= uid_tree from dbo.JobQueue with (nolock) where uid_job = @UID_Job if isnull(@UID_JobSameServerExists, '') = '' begin goto endLabel end if @UID_JobSameServerExists
6 = @UID_Job begin goto endLabel end insert into @erg(UID_Job, UID_JobSameServerOld, UID_JobSuccess, UID_JobError) select q.UID_Job, q.UID_JobSameServer
7, q.UID_JobSuccess, q.UID_JobError from dbo.JobQueue q with (nolock) where q.UID_Tree = @UID_Tree update @erg set UID_JobSameServerNew = @UID_Job where
8 UID_Job = @UID_Job select @CountItems = 1 while @CountItems > 0 begin update @erg set UID_JobSameServerNew = @UID_Job from @erg t join (select m.UID_JobSuccess
9 from @erg m where m.UID_JobSameServerNew > ' ' ) as s on t.UID_Job = s.UID_JobSuccess where t.UID_JobSameServerOld = @UID_JobSameServerExists and t.UID_JobSameServerNew
10 is null         select @CountItems = @@rowcount update @erg set UID_JobSameServerNew = @UID_Job from @erg t join (select m.UID_JobError from @erg m where
11 m.UID_JobSameServerNew > ' ' ) as s on t.UID_Job = s.UID_JobError where t.UID_JobSameServerOld = @UID_JobSameServerExists and t.UID_JobSameServerNew is
12 null         select @CountItems += @@rowcount end   update @erg set UID_JobSameServerNew = UID_Job where UID_JobSameServerNew is null and UID_JobSameServerOld
13 = @UID_JobSameServerExists endLabel: return end 
14

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

None extracted.

Summary: writes INSERT into; reads/joins JobQueue

Declared parameters

ParameterTypeDirection
@UID_Jobvarchar(38)input

DML targets

INSERT into

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_Job @erg @UID_JobSameServerExists @UID_Tree @CountItems @rowcount

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.QBM_PJobQueueSetSameServerSQL expression dependencydbo · OBJECT_OR_COLUMN
dbo.QBM_PJobUpdateState_BulkSQL expression dependencydbo · OBJECT_OR_COLUMN
dbo.QBM_PJobQueueSetSameServersource text referencehas TRY/CATCH error handling
dbo.QBM_PJobUpdateState_Bulksource text referencecreates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, fires object-layer event via HOFireEvent, has TRY/CATCH error handling