locked
Getting an error during synchronization RRS feed

  • Question

  • Hi,
    I am trying to sync a table with 2 different scopes.
    Scope-1: Sync all the Columns in the table(Only Upload)
    Scope-1: Sync only 2 columns in the table(Only Download)

    I am getting the following exception while sycnchroning the Scope-2(with 2 columns).

    Failed to execute the command 'BulkInsertCommand' for table 'TableName'; the transaction was rolled back. Ensure that the command syntax is correct.

    Trying to pass a table-valued parameter with 6 column(s) where the corresponding user-defined table type requires 8 column(s).

    Help give yur suggestion to resolve this issue.

    Thanks

    P

     


    Thursday, May 26, 2011 5:47 AM

Answers

  • I have added the Columns in the "ChangeSelect" event. Now I can able to sync the same table with 2 different Scopes.

     

    Thanks for the discussion.

    • Marked as answer by Pradyumna Friday, May 27, 2011 2:30 PM
    Friday, May 27, 2011 2:30 PM

All replies

  • while you can define multiple scopes against the same table, the scopes should have the same structure as the first one.

    am assuming you created 2nd scope using the SetCreateProceduresForAdditionalScopeDefault property, this gives you  newly defined scope with a new SelectChanges SP.

    however, this new scope shares the same User Defined Table Type, Triggers and Insert/Update stored procs. 

    so in your case, if you provisioned Scope 1 first, the UDT and Insert/Update stored procs have all the columns defined in it and sync will fail when your second scope passes a lesser number of columns to it.

     

    Thursday, May 26, 2011 8:20 AM
  • Yes..June
    You are right. I am also using the "ObjectPrefix" to create different Stored procedures for each scope. I am able to see different tables and sps for each scope.
    But still I am getting the same error.

    I want to sync a table with all the columns in "Upload" and only 2 cloumns in "Download". Are you getting my scenario?

    Please suggest ur idea.

    Thanks

     

     

    Thursday, May 26, 2011 9:37 AM
  • Now getting some different exception

    Expected column 'Column1' was not found on the DataTable to be applied to the destination table 'Table1'.
    Parameter name: dataTable

    Thanks

    P

    Thursday, May 26, 2011 10:05 AM
  • can you confirm that you have two UDTs created for each scope? you can also check the scope_config table and confirm if the config xml are pointing to the right SPs...
    Thursday, May 26, 2011 10:47 AM
  • Yes..There are separate SPs and User defind Types for different scopes. Each UDT is started with the "ObjectPrefix" value.
    But the only SP is being shared and i.e.

    All other are changed.

    (Started with "ObjectPrefix")

    SelChngProc="[Table1_selectchanges]" .

    Thursday, May 26, 2011 11:14 AM
  • so you only have one selectchanges sp?

    Thursday, May 26, 2011 11:58 AM
  • Yes..I have only one "selectchanges sp". How can I changed to 2 different SPs?

    It is not appending the "ObjectPrefix" to this SP.

    Thanks

    P

    Friday, May 27, 2011 11:10 AM
  • I have added the Columns in the "ChangeSelect" event. Now I can able to sync the same table with 2 different Scopes.

     

    Thanks for the discussion.

    • Marked as answer by Pradyumna Friday, May 27, 2011 2:30 PM
    Friday, May 27, 2011 2:30 PM