Finding LSN from a given time in SQL Server when CDC is disabled

505 Views Asked by At

How do we find out a LSN given a timestamp given that CDC is disabled ? I know that in case when CDC is enabled it can be done via fn_cdc_map_time_to_lsn stored procedure but is there a way to get to the same info when CDC is not enabled.

1

There are 1 best solutions below

4
David Browne - Microsoft On

I don't think there's a supported way to do that. You could use the undocumented fn_dblog, eg

select l.[Current LSN], coalesce([Begin Time],[End Time]) lsn_time
from  fn_dblog(null,null) l
where [Begin Time] is not null or [End Time] is not null