Seemingly valid code for querying the latest tracked changes in the table Fields
:
DECLARE @Begin_LSN BINARY(10), @End_LSN BINARY(10)
SET @Begin_LSN = sys.fn_cdc_get_min_lsn('Fields')
SET @End_LSN = sys.fn_cdc_get_max_lsn()
SELECT * FROM cdc.fn_cdc_get_all_changes_ordering_Fields (@Begin_LSN, @End_LSN, N'all')
GO
generates the following error message:
Msg 313, Level 16, State 3, Line 5
An insufficient number of arguments were supplied for the procedure or function cdc.fn_cdc_get_all_changes_ ... .
However, if I check for actual values they all seem to be valid (not null), the query
SELECT @Begin_LSN, @End_LSN, N'all';
returns
0x00000000000000000000 0x00002594000002130001 all