Migrate from SQLCE 4 to SQL Server 2008

自作多情 提交于 2019-12-21 20:25:33

问题


So, being an early adopter, I have developed an application based on SQLCE4, ASP.Net MVC3 and Entity Framework CTP5 (code first) based on a fit of recklessness induced by reading this announcement.

Now the application is moving into production and we need to lose the ce in favour of SQL Server 2008 and later azure.

Scott Gu mentioned that tooling would be out soon to support such migrations but I wonder if we're too early to take advantage of an easy route.

Anyone done it? Is there a simple migration path? Something like the MDF create script option in Visual Studio?


回答1:


Have you looked at SQL Server Compact Toolbox and SQL Compact data and schema script utility on codeplex?

It allows you to script schema and data to a .sql file, which can be used in any context. It also scripts DML for use in SSMS scripts.

You can use the resulting script for documentation, programmatic scripting of SQL Compact database files, or migration of schema and data to SQL Server (Express) 2005 or later




回答2:


You can do so using Webmatrix too

Here's a good explanation: http://www.sarasota.me/blog/migrate-orchard-database-sql-server-ce-to-sql-server-webmatrix




回答3:


I've followed the instructions from this blog post by ErikEJ and the migration was simple and successfull using only three steps:

  1. ExportSQLCE.exe "Data Source=D:\Orchard.sdf;" OrchardSqlCe.sql
  2. sqlcmd.exe -S .\SQLEXPRESS -Q "CREATE DATABASE Orchard"
  3. sqlcmd.exe -S .\SQLEXPRESS –d Orchard -i OrchardSqlCe.sql

ExportSqlCe is a tool written by the same ErikEJ which exports both schema and data to a text file.



来源:https://stackoverflow.com/questions/5716668/migrate-from-sqlce-4-to-sql-server-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!