I am trying to get Sql Server Change Data configured and am running into problems trying to query the tables.
My setup:
create table Person (
Id uniqueidentifier PRIMARY KEY DEFAULT NewSequentialId(),
FirstName varchar(255),
LastName varchar(255),
Age int,
AddressId uniqueidentifier
);
exec sys.sp_cdc_enable_table @source_schema='dbo',
@source_name='Person',
@role_name='AuditUserX',
@supports_net_changes = 1
And my query to get the data out of the tracking tables:
declare @Min binary(10), @Max binary(10)
set @Min = sys.fn_cdc_get_min_lsn('dbo.Person')
set @Max = sys.fn_cdc_get_max_lsn()
select @Min, @Max
select * from cdc.fn_cdc_get_net_changes_dbo_Person(@Min, @Max, N'all') //fails
GO
The last line before the GO
fails with the following error:
Msg 313, Level 16, State 3, Line 18
An insufficient number of arguments were supplied for the procedure or function
cdc.fn_cdc_get_net_changes_ ... .
Aucun commentaire:
Enregistrer un commentaire