How can I manage SQL CE databases in SQL Server Management Studio?

Edward Tanguay picture Edward Tanguay · Feb 23, 2009 · Viewed 38.4k times · Source

I created a SDF (SQL CE) database with Visual Studio 2008 (Add / New Item / Local Database).

Is it possible to edit this database with SQL Server Management Studio? I tried to attach it but it only offered .mdf and attaching a .sdf file results in "failed to retrieve data for this request".

If so, is it possible to create SDF files with Management Studio as well? Or are we stuck with the simple interface of the Visual Studio 2008 database manager?

Answer

Kumar picture Kumar · Jul 2, 2009

You can create .sdf files with SQL Server 2008 Management Studio.

In the File > Connect Object Explorer dialog, change the Server Type dropdown to SQL Server Compact Edition.

Then in the Database File dropdown choose New Database.... and you're ready to go.