Forum Discussion

BartNSTCL's avatar
BartNSTCL
Copper Contributor
Nov 03, 2025

Temporal Table - Change the ValidFrom Time

Sql Server 2022 - We needed a new 'Bonus' value to be active from 11/01/2025 06:00:00. I created a one time SQL job to update the temporal table for the Bonus value (going from 2.175 to 2.00) to run at 11/01/25 06:00:00. In the temporal table, the valid from is (converted to the local time) 2025-11-02 06:00:00.5656752 -06:00. If I pass FOR SYSTEM_TIME FROM '2025-11-02 06:00:00' TO '2999-01-01 23:59:59.999', I will get the previous since the job was just over a 1/2 second late. I've read articles talking about turn off versioning, then updating the History and current tables, then turning versioning back on. Seems like thats not possible with a generate always ValidFrom. I tried to create a temporal table where Validfrom as GENERATED BY DEFAULT but that didn't work. Is there a way I can get my validFrom to exactly 11/01/2025 06:00:00? Is there a better way in the future to get things set to exactly a desired time?

No RepliesBe the first to reply

Resources