0

I have been developing a site using entity framework and sql server compact edition that is no wready to be deployed. SqlCE along with EF code first has been great - it has dramatically reduced my development time.

However, I am hosting the site with an external hosting company, and due to potential issues with file access and reliability - I now wish to script the database and copy it to an instance of sql server management studio that I get included with my hosting.

  • First - is it possible to script the tables in Visual Studio server explorer?

  • Second - if not, how can I connect to the .sdf file in management studio? I have attempted to connect to the file in management studio (the option to open sql compact edition is there in the connect dialog), but the error This is not a valid sql server compact database file or this file version is not supported by current Sql server compact engine

Anyone got any ideas?

p.s. I am using Sql Server Management Studio 2008 R2 and Sql Server CE 4

2 Answers 2

2

You can use my tools to create a script that you can run against your SQL Server Database. SSMS 2008 R2 only supports SQL Server Compact version 3.5. You can use the 4.0 version command line tools from here: http://exportsqlce.codeplex.com or my Visual Studio add-in: http://sqlcetoolbox.codeplex.com

Sign up to request clarification or add additional context in comments.

1 Comment

looks like just what I want - I hate messing around in management studio unless I absolutely have to, I will let you know if it solves my problem
1

Sql Server Management studio doesn't support Sql Server CE 4. The only support is in Visual Studio 2010 SP1 (I'm not sure if you need SQL Ce 4 Tools as well). I guess you can try very new EF Power Tools CTP1 which offers View Entity Data Model DDL SQL - it should be exactly what you need.

4 Comments

That looks like a really handy plugin, but it actually does the opposit of what I want! However, it is something I will probably use in future to convert old projects to EF code first without touching existing db's...
It should support both directions - creating code first from existing database and script database from the code first.
in the context menu when I right click on a project there is only one option - 'Reverse Engineer Code First'
Did you read article in the link? There are additional features if you use context menu on the file containing DbContext.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.