Ravi Jain
Ravi Jain

Reputation: 86

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

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.

Upvotes: 1

Views: 916

Answers (1)

David Browne - Microsoft
David Browne - Microsoft

Reputation: 89141

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 

Upvotes: 1

Related Questions