Accepted answer
-
Viorel 89,396 Reputation points
2021-03-29T18:01:16.717+00:00 It seems possible to identify an approximate relation between date and SecondValueA. Check an example:
declare @date as datetime2 = cast('2021-03-29 14:12:37.163' as datetime2) declare @secondValueA bigint declare @x1 datetime2 = cast('2021-03-29 14:10:07.159' as datetime2) declare @x2 datetime2 = cast('2021-03-29 14:15:37.162' as datetime2) declare @y1 bigint = cast(-232845330 as bigint) declare @y2 bigint = cast(-1227785454 as bigint) + cast(0x100000000 as bigint) set @secondValueA = @y1 + (@y2 - @y1) * datediff_big(mcs, @x1, @date) / datediff_big(mcs, @x1, @x2) if @secondValueA > 0x7FFFFFFF set @secondValueA -= cast(0x100000000 as bigint) select @date as [date], @secondValueA as SecondValueA
i tried this (SELECT DATEDIFF(ms, (select sqlserver_start_time from
sys.dm_os_sys_info), '2021-03-29 14:10:07.159')) but ...
these are data from Performance Monitor