locked
How do we specify the schema in DbSyncTableDescription? RRS feed

  • Question

  • When I set the LocalName property in DbSyncTableDescription to, for example, "TheSchema.TheTable", the schema gets removed. I tried fully quoting the name (i.e., "[TheSchema].[TheTable]", and that didn't work either. In both cases, LocalName ended up getting set to just "TheTable". Is there a way to tell DbSyncTableDescription not to strip out the schema?
    • Moved by Max Wang_1983 Thursday, April 21, 2011 11:29 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, September 8, 2009 4:05 PM

Answers

  • Joe,

    This is a known issue in CTP2 and will be fixed in RTM.  As a workaround, you can set the table name using the DbSyncTableDescription constructor that takes the table name instead of the LocalName property.  This should correctly handle the schema name.  Hope that helps.

    Thanks-
    Phil
    • Proposed as answer by Phil Piwonka Friday, September 11, 2009 9:55 PM
    • Marked as answer by Joe Farlow Saturday, September 12, 2009 7:33 PM
    Friday, September 11, 2009 9:54 PM

All replies

  • Joe,

    You should use SqlSyncTableProvisioning.ObjectSchema to specify the desired schema.  See more info at the link below:

    http://msdn.microsoft.com/en-us/library/microsoft.synchronization.data.sqlserver.sqlsynctableprovisioning_members(SQL.105).aspx


    Regards,

    Sean Kelley
    Senior Program Manager
    Microsoft
    Tuesday, September 8, 2009 8:06 PM
    Moderator
  • Thanks for the reply Sean, but I'm actually looking for how to specify a table that is in a particular schema, not specify the schema of the sync objects. When I try setting LocalName equal to the fully-qualified name of the table, it strips out the schema for some reason.
    Wednesday, September 9, 2009 4:31 AM
  • Joe,

    This is a known issue in CTP2 and will be fixed in RTM.  As a workaround, you can set the table name using the DbSyncTableDescription constructor that takes the table name instead of the LocalName property.  This should correctly handle the schema name.  Hope that helps.

    Thanks-
    Phil
    • Proposed as answer by Phil Piwonka Friday, September 11, 2009 9:55 PM
    • Marked as answer by Joe Farlow Saturday, September 12, 2009 7:33 PM
    Friday, September 11, 2009 9:54 PM
  • Thanks for the info Phil.

    Saturday, September 12, 2009 7:45 PM