0

I have never used SQL Server CE before, but I have a small project which would benefit from CE instead of full-blown SQL Server.

Within Visual Studio I can create the DB schema which then generates an SDF file. I'm assuming that schema and data both go in here.

Now let's say it contains just 1 simple table:

Customer
========
ID int PK
FirstName varchar(50)
Surname varchar(50)

I build a C# Win Forms application and then send it to the client. They use it for a bit to record customers, and then say they would like to include a Mobile number. I then alter the table as follows:

Customer
========
ID int PK
FirstName varchar(50)
Surname varchar(50)
MobileNo varchar(50)

I alter the C# Win Forms application to be aware of the new field, but now when I send the software to the client, how can I update their database?

I want all existing data within the client's .sdf file to be exactly as it was, but I want to alter the schema of it to include the new MobileNo field.

Is there some kind of schema deployment built into the SQL Server CE libraries?

Laurence Frost
  • 2,759
  • 3
  • 28
  • 45
  • Pretty sure you can just use sql syntax for that: ALTER TABLE, etc. – LarsTech Mar 10 '15 at 17:01
  • The Toolbox can create schema diif scripts, which you can use a the basis for the updates to run on the client, also having a schema version stored in the Client database will help you – ErikEJ Mar 10 '15 at 17:20

0 Answers0