For all migrations, a special variable exists named CURRENT_EXECUTION_TIMESTAMP. At execution time, this will return the date/time when the current execution started. This variable has the following special properties compared to user-defined variables:
- It is not visible in the Project Variables List - it cannot be removed or edited.
- It is not visible in the Variable Values List shown in Execution Options. Users cannot manually set the value of this variable at execution time.
- When a Source Filter Count is performed at Design Time and this variable is included in the query, the variable is given a value of the current date/time (UTC timezone)
- When the project is executed, the variable is set to the date/time that the execution status changed to Executing'.
Apart from the above, the variable can be used in exactly the same way other project variables in the source query.
This variable is particularly useful when frequent 'Delta' migrations are running to keep two servers in sync. Records may be being added/deleted/updated while the execution is running. The records can be filtered to only consider records that were last updated (or created) before the execution started. This will prevent a situation where records created or updated after the execution started end up being migrated twice (once in the current migration and once in the subsequent migration). This behaviour can be a performance issue, particularly if the migration is running a high percentage of the time.
The following query is commonly used in delta/ synchronisation migrations (ServiceNow Source Server shown here) Only records updated between the last migration timestamp and the current migration timestamp will be included. Any records updated during execution will not be included in the current execution, but will be migrated in the next execution.

Comments
0 comments
Please sign in to leave a comment.