Question

I am trying to use CDC in my sql database, I use a stored procedure to move the data from the temporary CDC tables to new tables. I also move the Start_lsn stamp. In the new tables I try using the fn_cdc_map_lsn_to_time to map the lsn to time, for some records it returns null and for others it returns the correct time, this is an example:

NULL                    0x000034D5000002F80001
2014-01-16 00:38:39.377 0x0000350F000006D70001

NULL                    0x00003513000003BA0001  2   0x3FFFFF
2014-01-18 02:00:05.320 0x0000351E000009FA0001  2   0x3FFFFF

is there any explanation.

Thanks

Was it helpful?

Solution

I found the answer and I just want to add it for the record.

The problem here is that I moved the records from the CDC tables to my own tables to prevent them from being deleted.

fn_cdc_map_lsn_to_time uses a system table to map the LSN from the cdc tables to time stamp. after some time those records will be deleted that is why some of the records where mapped correctly to time because they were recently added,

but the old ones were not mapped because they were already deleted.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top