25

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?

Anthony Mastrean
  • 21,850
  • 21
  • 110
  • 188
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047

3 Answers3

22

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.

Jim Dagg
  • 2,044
  • 22
  • 29
15
  • Management Studio 2005 supports SQL CE 3.0.
  • Management Studio 2005 SP2 supports up to SQL CE 3.1.
  • Management Studio 2008 supports up to SQL CE 3.5 SP1

I think Management Studio Express 2008 does not support SQL CE databases.

Lucas
  • 17,277
  • 5
  • 45
  • 40
  • 22
    Just to add a brief update now that SQL CE 4.0 is out. SQL management studio 2008 does not support SQL CE 4.0. There are some helpful tools at http://sqlcetoolbox.codeplex.com/. Also see http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/7588375e-3069-4d68-9365-29feb25b7296 and 1. http://weblogs.asp.net/scottgu/archive/2011/01/11/vs-2010-sp1-and-sql-ce.aspx – Michael Levy May 12 '11 at 15:49
  • 1
    sqlcetoolbox did it for me. If this was an answer, I'd upvote it. – Cristian Diaconescu Oct 20 '12 at 13:25
1

Were you using Management Studio 2005, or 2008? It should work in 2008 if you create a SQL CE 3.5 database ... just not in 2005.

Beep beep
  • 18,873
  • 12
  • 63
  • 78
  • 1
    When I tried to open up a CE sdf in 2008 studio I get an error "There is no editor available for xxxx.sdf" – Dan May 11 '09 at 11:14