Monday, May 24, 2010

What’s new in SQL Server Compact 3.5 SP2 beta

Disclaimer: I am guessing some of this, as no documentation is currently available!

SQL Server Compact 3.5 SP2 beta is available for download for x86 and x64 (no Windows Mobile yet) here: and is also included with Visual Studio 2010 beta 2. I will try to update this blog entry as more information becomes available.

Notice that the installation of 3.5 SP2 beta upgrades a 3.5 and 3.5 SP1 installation. Also, this is beta software, so use at your own risk!

Firstly, 3.5 SP2 beta includes all the hotfixes, that has been released for 3.5 SP1, as listed by me here.

The SQL Compact 3.5 folder look like this after installation:


Notice the “Private” folder, which contains a version of System.Data.SqlServerCe.Dll which should be used for private deployments, to prevent the “Assembly probing” issue described in this forum thread. The problem is, that even if you are using a hotfixed version of SQL Compact in your application folder, assembly probing will load the GAC deployed version, which may or may not be hotfixed. This means that the deployment of a hotfix always must be done by an administrator, which may not always be possible.

Ravi Tandon from the product team add the following comments about EF related fixes in the beta (from same thread):

“In context of this thread this will alleviate these issues for you:
1. Fixes the ntext error, or any EF queries that use String Parameters. (Hotifx -, earlier released has been rolled up)
2. Fixes the "AS" error. (Same Hotifx had this fix too and has been rolled up)
3. This MSI will do the seamless upgrades. You just need to use this MSI for ClickOnce and any other scenarios. No Uninstalls anymore.
4. We also got some reports of bad performance with EF designers if the Schema get's a bit complex and big. We have made changes for that, which should make the performance better.
As always, we are open for feedback, suggestions, comments.
Thanks a lot for using our product and the continued support!

The 3.5 SP2 beta adds a few new APIs in the ADO.NET provider:



1: A new property has been added to the SqlCeReplication object (merge replication agent): PostSyncCleanup – it is “documented” here.

2: The SqlCeEngine.Repair methods RepairOptions have changed (documented here):

DeleteCorruptedRows –> DeleteCorruptedRows

RecoverCorruptedRows –> RecoverAllPossibleRows (RecoverCorruptedRows is obsolete)

New Enum value: RecoverAllOrFail



An entirely new class is now available, called SqlCeChangeTracking. It exposes methods to programmatically enable, query and disable change tracking, something that was only available to the Visual Studio “Local Data Cache” designer (for Sync Framework applications.) I am looking forward to more documentation on this API!

Hope this helps, and looking forward to the final release of SQL Server Compact 3.5 SP2.

UPDATE: Ravi Tandon has posted even more info here

UPDATE 2: The VS 2010 RC contains a newer build (3.5.8078.0), and includes a readme file, that documents a couple of issues:

1: A ClickOnce application that uses DbProviderFactory to load the SQL Server Compact 3.5 SP2 provider will not work in the following cases:

· A computer already has SQL Server Compact 3.5 SP2 and .NET FX 2.0, 3.0, or 3.5 installed, and the ClickOnce application installs .NET FX 4 and SQL Server Compact 3.5 SP2 on the computer.

· A computer already has SQL Server Compact 3.5 SP2 and .NET FX 4 and installed and the ClickOnce application installs .NET FX 2.0, 3.0, or 3.5 on the computer.

The workaround is to repair the SQL Server Compact 3.5 SP2 installation from Add/Remove Programs.

2: Ensure that if a database is created with SQL Server Compact 3.5 SP2 change tracking is also enabled with SQL Server Compact 3.5 SP2.

3: The SQL Server Compact 3.5 SP2 Query Tools Windows installer file (MSI) is uninstalled when SQL Server 2008 and SQL Server 2008 R2 are installed side-by-side and then SQL Server 2008 is uninstalled.

For more information, see the ReadmeSSCE35_ENU.htm in the C:\Program Files\Microsoft SQL Server Compact Edition\v3.5 folder, when build 3.5.8078.0 is installed.



The final build released with VS 2010 is 3.5.8080.0.

The Desktop installer is a self-extracting .exe, that includes the following warning – On a 64-bit system both the 64-bit and 32-bit must be installed!



UPDATE 4: A workaround for a private deployment bug with SP2 (when using Entity Framework) is described here:


Steven Ellis said...


SQL Server Compact recreates the indexes on PPC device since the NLS version of Vista and PPC are different on first connection.

Does 3.5SP2 resolve this issue? If not, is there any work around?


Steve Ellis

ErikEJ said...

Steve: See my reply to your post in the MSDN forum

Unknown said...

Hi, Eric, can I use the SqlCeChangeTracking with compact framework 3.5? Did they update the compact framework .dll?


ErikEJ said...

I do not think so: