I have to create a local copy of the database inside a .Internet application to ensure that it may function offline. My server database is SQL Server 2005, and it is copying to SQL Server 2008 Express.

It does not need to be anything fancy - just begin with scratch (or remove the present db), copy all tables/constraints/foreign secrets, and copy data from a few of the tables. I do not mind keeping a "schema version" during my database to ensure that the application knows when its existing schema is outdated.

I have been considering the Microsoft Sync Framework, also it seems that I must create a SyncTable for every table during my database, and frankly, that appears like an excessive amount of work and maintenance. This is actually the code that I am finding in good examples:

SyncTable orderDetailSyncTable = new SyncTable("OrderDetail");
orderDetailSyncTable.CreationOption = TableCreationOption.DropExistingOrCreateNewTable;
orderDetailSyncTable.SyncDirection = SyncDirection.Snapshot;
orderDetailSyncTable.SyncGroup = orderSyncGroup;
this.Configuration.SyncTables.Add(orderDetailSyncTable);

I guess I possibly could list all of the tables during my database and enumerate them over, however it just appears like there must be an easy method. Shall We Be Held missing something within the Sync Framework, or perhaps is there another thing that will make this happen kind of factor?

I threw in the towel on Sync Framework using SQL Server Management Objects to do this rather.

http://msdn.microsoft.com/en-us/library/ms162169.aspx