Отвечено Message 313 CDC

  • 3 мая 2012 г. 11:14
     
     

     Hi,


    my problem is when i want to create tree data capture the first one is created but the others not!! and it return the msg 313


    My query for the second capture  is  :

    DECLARE @from_LSN binary(10), @to_LSN binary(10);
    DECLARE @begin_time Datetime;
    DECLARE @end_time Datetime;
    select @begin_time = GETDATE()-1;
    select @end_time = GETDATE();
    SET @from_LSN = sys.fn_cdc_map_time_to_lsn ('smallest greater than ', @begin_time );
    --SET @from_LSN = sys.fn_cdc_get_min_lsn('dbo_CCP_BCI');
    SET @to_LSN = sys.fn_cdc_map_time_to_lsn ('largest less than', @end_time );
    --SET @to_LSN = sys.fn_cdc_get_max_lsn();
    select * FROM cdc.fn_cdc_get_all_changes_dbo_CCP_COMMISSION(@from_LSN,@to_LSN,'all')

       pleaase  i need your help


Все ответы

  • 10 мая 2012 г. 6:19
    Модератор
     
     Отвечено

    Hi mabrouko,

    The error of 313 may arise when the LSN you specified as parameter for function cdc.fn_cdc_get_all_changes_dbo_CCP_COMMISSION is not a valid one, such as the value of @from_LSN is less than the min LSN, or the value of @to_LSN is larger than the max LSN for the capture instance. Please see: CDC: dbo.fn_all_changes_... frustrating.

    The code above works on my environment. Could you please out put both @from_LSN and @to_LSN to see if the values are existed in cdc.lsn_time_mapping table if the error persists?


    Stephanie Lv

    TechNet Community Support