locked
Default Values RRS feed

  • Question

  • Hi

     

    When a table is created by the sync service on the client from the server table's schema, default column values are not preserved, (eg we default the primary key to newid(), numeric columns to zero etc ). Is there a way for these values to be automatically copied from server schema to client schema or do i have to manually update the client table in the SyncAgent.CreatingSchema event

    • Moved by Max Wang_1983 Friday, April 22, 2011 10:27 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, July 11, 2007 9:16 AM

Answers

  • Hi Alan,

     

    The SyncSchemaColumn allows you to add extra information to the schema. One of those things are the default values. However, specifying a query or a function as a default is not supported.

    The other way to work around this is to subscribe to SchemaCreated event on the client side and add any extra defaults, indexes ... etc; the event is fired one time for each table being created.

     

    Thanks

    Wednesday, July 11, 2007 3:26 PM