locked
SqlSyncScopeProvisioning.ObjectSchema RRS feed

  • Question

  • The documentation for this property suggests that I can have tables in one database, and the ObjectSchema property lets me track the changes in another database. That is, the generated trigger in the database containing my data will update the tracking tables in the database containing my tracking tables. Is that how it's meant to work (it doesn't) or have I just implemented incorrectly?
    Thursday, December 8, 2011 2:11 PM

Answers

  • I suggest you read on what SQL Server Database Schema's are: http://msdn.microsoft.com/en-us/library/ms190387.aspx

    The Sync Framework get's provisioned in the database you specify in the connection string. The Object Schema has nothing to do with it.

    assuming you get the Sync Framework objects in another database and only the triggers on the original database, how are you going to select and apply changes? are you going to make a cross-database call with the stored procedures selecting and applying changes residing in one database updating data in another database?

    • Marked as answer by d_caveney Monday, December 12, 2011 8:21 PM
    Saturday, December 10, 2011 11:05 AM

All replies

  • The documentation for this property suggests that I can have tables in one database, and the ObjectSchema property lets me track the changes in another database. That is, the generated trigger in the database containing my data will update the tracking tables in the database containing my tracking tables. Is that how it's meant to work (it doesn't) or have I just implemented incorrectly?
    • Moved by Paul Zhou Thursday, December 8, 2011 6:09 AM move for better support (From:.NET Base Class Library)
    • Merged by KJian_ Friday, December 9, 2011 8:16 AM
    Wednesday, December 7, 2011 6:23 PM
  • I've re-posted this question on "SyncFx - Microsoft Sync Framework Developer Discussions forum"
    Thursday, December 8, 2011 2:12 PM
  • not sure which documentation you're referring to that alludes to the ObjectSchema referring to a separate database.

    the schema being referred to is a Sql Server schema object e.g., dbo, or other user defined schema. not a database schema per se.

    you use the ObjectSchema name if you dont want the Sync Framework created under the dbo schema or default user schema.

    Thursday, December 8, 2011 11:32 PM
  • Thanks for replying.

    The documentation I was referring to is the SqlSynProvider Class description for ObjectSchema: "Gets or sets the database schema in which Sync Framework creates objects."

    I also found in "How to: Provision and Deprovision Synchronization Scopes and Templates (SQL Server)":

    "The synchronization elements can be collected in a separate schema in the database. To do this, specify the schema name in the SqlSyncScopeProvisioning.ObjectSchema property. The schema must already exist in the database. If you use a schema when you provision a database, you must specify the same schema whenever the scope is used. For example, you must specify the SqlSyncProvider.ObjectSchema property when the database is synchronized."

    I suppose I was confusing "separate schema in the database" with "separate schema in the instance" (I'm still not sure what a "separate schema in the database" would be). To add to my confusion, I was actually able to provision to a different database in the same instance by using the ObjectSchema property, but the tables, triggers, etc. looked more like what you get when you provision for a client-side database: data-tables, triggers, tracking-tables, everything got created. I was expecting that the tracking tables would get created in one database and the triggers in the original database, so you wouldn't have to mess-up your database with a lot of tracking tables.

    So, what is the problem that the ObjectSchema property was meant to resolve? (don't assume too much...they keep the programmers away from the database in most of the places I've worked)

     

    Friday, December 9, 2011 2:58 PM
  • I suggest you read on what SQL Server Database Schema's are: http://msdn.microsoft.com/en-us/library/ms190387.aspx

    The Sync Framework get's provisioned in the database you specify in the connection string. The Object Schema has nothing to do with it.

    assuming you get the Sync Framework objects in another database and only the triggers on the original database, how are you going to select and apply changes? are you going to make a cross-database call with the stored procedures selecting and applying changes residing in one database updating data in another database?

    • Marked as answer by d_caveney Monday, December 12, 2011 8:21 PM
    Saturday, December 10, 2011 11:05 AM
  • No, of course not, that would be crazy. Well maybe I was thinking about something like that. Well, ok, that's exactly what I meant.

    Thanks for replying, I'll check out that link.

    Monday, December 12, 2011 6:16 PM