locked
Filter Sync with Multiple Values form same source and destination. RRS feed

  • Question

  • Hi,

    I am currently database synching with filters(column name TOWN_CD_C) with (different values in morning and evening) and same source(Server Database) and destination(client).I find that the downloaded rows(in the morning) for a filter value , the application tries to upload (the rows with the filter values of morning) in the server when the filter value changes (at evening) .

    For ex : CR_SERVICE_REQUEST (column name : TOWN_CD_C: Filter Value :  4142) in morning.

    Downloaded rows : 60

     CR_SERVICE_REQUEST (column name : TOWN_CD_C: Filter Value : 4046) in morning.

    Uploaded rows : 60

    Downloaded rows : 1261

    I need to avoid the mentioned situation.

    Regards,

    Sachin K


    • Edited by sakulkarni83 Thursday, October 18, 2012 10:45 AM
    Thursday, October 18, 2012 9:15 AM

Answers

  • how did you provision the client scopes? if you use GetDescriptionForScope to grab the scope definition from server, the scope definition that you get doesnt include a filter. So your client scopes dont have filters which is why theyre picking up and echoing back to server the rows downloaded by other scopes.

    • Marked as answer by sakulkarni83 Monday, October 22, 2012 7:33 AM
    Friday, October 19, 2012 6:25 AM

All replies

  • do you have different scopes for every filter value?

    how did you provision the client scopes?

    Friday, October 19, 2012 1:42 AM
  • Yes

    I have different scopes for different  filter value.

    Say if the value is 4142, then scope name would be 4142_some fixedname.

    If the value is 4140, then scope name would be 4140_some fixed name.

    Also ,please let me know if we can have multiple values for filter in a particular scope.

    Friday, October 19, 2012 5:50 AM
  • how did you provision the client scopes? if you use GetDescriptionForScope to grab the scope definition from server, the scope definition that you get doesnt include a filter. So your client scopes dont have filters which is why theyre picking up and echoing back to server the rows downloaded by other scopes.

    • Marked as answer by sakulkarni83 Monday, October 22, 2012 7:33 AM
    Friday, October 19, 2012 6:25 AM
  • Hi,

    I am provisioning at client side by below mentioned code.

    DbSyncScopeDescription scopeDesc = client.GetScopeDescription(scopeName, null, schemaName, serverConnStr);   

    Therefore I am providing GetScopeDescription method.Is there any other mechanism.

    Friday, October 19, 2012 6:37 AM
  • you will have to provision your client scopes in the same way you provision your server scopes.

    or you can add the filters after you make the call to GetDescriptionForScope

    Friday, October 19, 2012 7:07 AM
  • Thanks June,

    I want to add multiple values to filter as per new requirement.

    How can I achieve that?

    I have read in below mentioned url.

    http://jtabadero.wordpress.com/2010/09/02/sync-framework-provisioning/

    but still not able to do  that.

    Currently I have changed below in server side provisioning.

    For a filterClause ,I have written [side].[TOWN_CD_C] in (@TOWN_CD_C)

    I have value mentioned as 999,013.

    Now when provisioning is done ,I see that in sync.scope_parameters in  XMl file still I see  value as 999,013.

    But I see TOWN_CD_C as TOWN_CD_C = and not TOWN_CD_C IN in the xml file.

    Please guide me for the above concerns.


    Friday, October 19, 2012 12:13 PM
  • regardless of whether you use Sync Fx or not, i dont think SQL Server supports a parameter-based values in the IN clause.

    you might want to put the values in the IN clause in a separate table and to a sub-query in your IN clause instead...

    e.g.,  [side].[TOWN_CD_C] in (SELECT x from TableX)

    Monday, October 22, 2012 5:39 AM