How to migrate from SQL Server to SQL Server Compact Edition.

2 בנובמבר 2008

So you have decided that you want to incorporate SQL server CE into your application. I found out that almost every Smart Client or Desktop based Rich application need a way to cache data and Sql Server CE is a great tool to do just that.

Sql Compact Edition has a few advantages that might sway you if you still don’t think it is necessary. But the main problem most people while considering a transition to CE that you need to create a schema from an existing DB and the IDE lacks this ability up to now;
You just can’t run a “Create” script on it from the IDE.

To solve this issue you can use this simple nice trick: We will be using the Sync framework to build our local CE db for you.

To do so you need to open VS 2008 (SP1).

  1. Create a new project (doesn’t matter which one).
  2. Create New Item –> Local Database cache
  3. Choose your Connection to the source database
  4. Add the tables you want to create on your compact edition
  5. click OK.
  6. and here you go, the wizard will create the local Sql Server CE database file for you.

Good luck


Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


one comment

  1. Daniel10 בנובמבר 2009 ב 2:36

    Thanks Ariel, this was very helpful!