All Forums Database
svragavan81 8 posts Joined 08/15
25 Aug 2015
TIMESTAMP values gets updated with UTC values via Stored procedure.

We have the column defined as below
The column when updated via BTEQ, MACRO gives the output as below
8/21/2015 23:22:55.320000-07:00 (at local timezone)
when updated via stored procedure gives the output
UTC Time - 8/22/2015 06:22:39.360000+00:00 (at gmt)
Also the same procedure on a different DB region gives the local timezone
I'm not sure what is causing the value to be updated as "gmt" when done via SP but not via BTEQ, Macro..

Fred 1096 posts Joined 08/04
26 Aug 2015

DML requests (including macro execution) submitted directly will default to the current session time zone.
But within a SQL Stored Procedure, DML defaults to the time zone of the session which compiled the SP.

svragavan81 8 posts Joined 08/15
31 Aug 2015

Thanks Fred . The SP seems to have been recompiled with UTC. We re-compiled again with "AT local" using ALTER and it worked as expected.

You must sign in to leave a comment.