Back to OIM Explorer

dbo.QBM_ZStateUTCOffset2

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 941 characters

Interpretation

  • Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.

Relations

  • No extracted relations.

Typed Edges

  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.QBM_ZStateUTCOffset source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL40 lines
1CREATE PROCEDURE QBM_ZStateUTCOffset2(2  @SlotNumber int3)4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @XUser nvarchar(64) = object_name(@@procid)8  DECLARE @Xdate datetime = getutcdate()9  BEGIN TRY10    UPDATE DialogState11    SET AVGUTCOffSet = isnull(c.AVGUTCOffset,12    0),13    IsDayLightSaving = isnull(c.IsDayLightSaving,14    0),15    XDateUpdated = @Xdate,16    XUserUpdated = @XUser17    FROM DialogState s18    JOIN QBMDBQueueCurrent cu19      WITH(readpast)20      ON s.UID_DialogState = cu.UID_Parameter AND cu.SlotNumber = @SlotNumber21    JOIN DialogCountry c22      ON s.UID_DialogCountry = c.UID_DialogCountry23    LEFT24    OUTER25    JOIN DialogStateHasTimeZone sht26      ON s.UID_DialogState = sht.UID_DialogState27    WHERE28      sht.UID_DialogTimeZone IS NULL AND(isnull(s.AVGUTCOffset, 0) <> isnull(c.AVGUTCOffset, 0) OR isnull(s.IsDayLightSaving,29    0) <> isnull(c.IsDayLightSaving, 0))30  END TRY31  BEGIN CATCH32    EXEC QBM_PSessionErrorAdd DEFAULT33    RAISERROR('',34    18,35    1)36      WITH NOWAIT37  END CATCH38  ende:39  RETURN40END
Open raw exported source
SQL ยท Raw7 lines
1    create   procedure QBM_ZStateUTCOffset2 (@SlotNumber int) as begin declare @GenProcID varchar(38) declare @XUser nvarchar(64) = object_name(@@procid2) declare @Xdate datetime = getutcdate() BEGIN TRY  update DialogState set AVGUTCOffSet = isnull(c.AVGUTCOffset, 0) , IsDayLightSaving = isnull(c.IsDayLightSaving3, 0) , XDateUpdated = @Xdate , XUserUpdated = @XUser from DialogState s join QBMDBQueueCurrent cu with (readpast) on s.UID_DialogState = cu.UID_Parameter4 and cu.SlotNumber = @SlotNumber join DialogCountry c on s.UID_DialogCountry = c.UID_DialogCountry left outer join DialogStateHasTimeZone sht on s.UID_DialogState5 = sht.UID_DialogState where sht.UID_DialogTimeZone is null and ( isnull(s.AVGUTCOffset,0) <> isnull(c.AVGUTCOffset,0) or isnull(s.IsDayLightSaving,0) 6<> isnull(c.IsDayLightSaving,0) ) END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7