0

I can successfully capture change data from mssql CDC by issuing the query

cdc.fn_cdc_get_all_changes_capture_instance ( from_lsn , to_lsn , '<row_filter_option>' )

Here, from_lsn is the min_lsn(oldest uncommitted transaction) which I can obtain from the Database.

But I have an already committed old transaction which I want to replicate and so I obtained LSN for one of its rows and tried to issue the above query using the obtained LSN (from_lsn) which failed with the following error message

Failure in executing queries SQLException;ErrorCode : 313;SQLCode : S0003;SQL Message : An insufficient number of arguments were supplied for the procedure or function cdc.fn_cdc_get_all_changes_ ...

Is it possible to capture past changes from MSSql ? If yes, some guidance would be appreciated

  • Did you include all three arguments, or just the from_lsn? Based on the documentation it looks like you have to include all three. – Tony Hinkle Mar 27 at 17:38
  • "If the specified LSN range does not fall within the change tracking timeline for the capture instance, the function returns error 208 ("An insufficient number of arguments were supplied for the procedure or function cdc.fn_cdc_get_all_changes.")." – Tony Hinkle Mar 27 at 17:40
  • @TonyHinkle Can we replicate operations which were done before CDC was enabled on the table? – Anish Sharma Mar 28 at 2:59
  • 1
    I highly doubt it. I would be shocked if you get a definitive answer from anyone other than Microsoft support. If you didn't have change tracking enabled, it doesn't seem like it would, "fall within the change tracking timeline for the capture instance" Documentation at docs.microsoft.com/en-us/sql/relational-databases/… – Tony Hinkle Mar 28 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.