dbo.QBM_ZCountryUTCOffset

SQL_STORED_PROCEDURE

Created 2025-06-27T17:58:58.553 · modified 2026-04-14T23:20:29.223 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberintno

Referenced objects

SchemaObjectColumn/minorClass
dialogCountryOBJECT_OR_COLUMN
DialogCountryHasTimeZoneOBJECT_OR_COLUMN
dialogstateOBJECT_OR_COLUMN
dialogstateHasTimezoneOBJECT_OR_COLUMN
dialogTimezoneOBJECT_OR_COLUMN
QBM_PSessionContextSetOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBMDBQueueCurrentOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_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 QBM_ZCountryUTCOffset (@SlotNumber int) as begin declare @GenProcID varchar(38) declare @XUser nvarchar(64) = object_name
2(@@procid) declare @Xdate datetime = getutcdate() declare @uid_dialogCountry varchar(38) declare @AVGUTCOffSet int declare @IsDayLightSaving bit declare
3 @GenProcID_R varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser') declare @ElementBuffer QBM_YCursorBuffer
4 declare @ElementCount int declare @ElementIndex int BEGIN TRY insert into @ElementBuffer (UID1, UID2) select c.uid_dialogCountry, p.GenProcID from dialogCountry
5 c join QBMDBQueueCurrent p with (readpast) on c.uid_dialogCountry = p.uid_parameter where SlotNumber = @SlotNumber select @ElementCount = @@ROWCOUNT select
6 @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @uid_dialogCountry = bu.UID1 , @GenProcID = UID2 from @ElementBuffer bu where
7 bu.ElementIndex = @ElementIndex  if exists (select top 1 1 from dialogstate s join dialogstateHasTimezone sht on s.uid_dialogState = sht.uid_DialogState
8 join dialogTimezone tz on sht.uid_dialogTimezone = tz.uid_dialogTimezone where s.uid_dialogCountry = @uid_dialogCountry and s.isinuse = 1 and tz.utcoffset
9 is not null ) begin  select @AVGUTCOffSet = avg(tz.UTCOffset), @IsDayLightSaving = sign(max(convert(int, tz.IsDayLightSaving))) from dialogstate s join
10 DialogStateHasTimeZone sht on s.uid_dialogstate = sht.uid_dialogState join DialogTimeZone tz on sht.uid_DialogTimeZone = tz.uid_dialogTimeZone where s.uid_dialogCountry
11 = @uid_dialogCountry and s.isinuse = 1 and tz.utcoffset is not null end else begin  if exists (select top 1 1 from DialogCountryHasTimeZone cht join dialogtimezone
12 tz on cht.uid_dialogTimezone = tz.uid_dialogTimezone where uid_dialogCountry = @uid_dialogCountry and tz.utcoffset is not null ) begin  select @AVGUTCOffSet
13 = avg(tz.UTCOffset), @IsDayLightSaving = sign(max(convert(int, tz.IsDayLightSaving))) from DialogCountryHasTimeZone cht join DialogTimeZone tz on cht.uid_DialogTimeZone
14 = tz.uid_dialogTimeZone where cht.uid_dialogCountry = @uid_dialogCountry and tz.utcoffset is not null end else begin  select @AVGUTCOffSet = 0 select 
15@IsDayLightSaving = 0 end end exec QBM_PSessionContextSet 'GenProcID', @GenProcID exec QBM_PSessionContextSet 'XUser', @XUser update dialogCountry set 
16AVGUTCOffSet = @AVGUTCOffSet , IsDayLightSaving = @IsDayLightSaving , XDateUpdated = @Xdate , XUserUpdated = @XUser where uid_DialogCountry = @uid_DialogCountry
17 and (isnull(AVGUTCOffSet, 0) <> @AVGUTCOffSet or AVGUTCOffSet is null or isnull(IsDayLightSaving, 0) <> @IsDayLightSaving or IsDayLightSaving is null 
18) select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: exec QBM_PSessionContextSet
19 'GenProcID', @GenProcID_R exec QBM_PSessionContextSet 'XUser', @XUser_R return end 
20

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

uses session context values has TRY/CATCH error handling

Summary: calls QBM_PSessionContextSet, QBM_PSessionErrorAdd; writes INSERT into, UPDATE dialogCountry; reads/joins dialogCountry, QBMDBQueueCurrent, dialogstate, dialogstateHasTimezone, dialogTimezone…; uses session context XUser, GenProcID

Declared parameters

ParameterTypeDirection
@SlotNumberintinput

DML targets

INSERT into UPDATE dialogCountry

Config/session

Config: None extracted.

Session: XUser GenProcID

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @SlotNumber @GenProcID @XUser @procid @Xdate @uid_dialogCountry @AVGUTCOffSet @IsDayLightSaving @GenProcID_R @XUser_R @ElementBuffer @ElementCount @ElementIndex @ROWCOUNT @uid_DialogCountry

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.