How to promote a SQL Server CE database to SQL Server 2008? - sql-server

I'm new to SQL Server CE, I'd like to ask if I start out small with a file based SQL Server CE database and in the future I want to move up to the regular SQL Server 2008 database, how and what is the best way to convert what I already have up to SQL Server 2008?

Description
At first, it is a good idea to start with SqlCE and go to Sql Server later.
Looks like you have to write own code to build the tables and populate them with data OR (and this is what i suggest) use a third party tool like primeworks DataPort.
More Information
Primeworks - Data Port Console
Extracting Data from SQL CE SDF file
How can I import data from SQL CE to SQL Server
Generate Script & Export Data From SQL CE (Compact Edition) 3.5

Related

Generate SQL Server Compact 3.5 to SQL script?

I need to convert a SQL Server Compact database file to SQL Server, so I think generate script is the best way, but I can't find anything in SQL Server CE Toolbox 3.5
Is there a workaround?

VB.NET - Switch Network SQL Server 2008 R2 Database to a mobile SQL Server CE *.sdf File

I have developed a VB.NET program using a strongly typed dataset. This dataset has its connection to a SQL Server 2008 R2. The software should now be additionally used offline. The database should be exported to a *.sdf database. If no connection to the SQL server is produced, the software have to try to connect to the *.sdf database.
I would like to achieve:
1. Export the data in the SQL Server 2008 R2 database to a local *.sdf file.
2. This *.sdf file has to work as an alternate connection string in the strongly typed dataset.
How can I achieve this?
My SQL Server Compact Toolbox can help you with question 1. http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html

Using SQL Server SDK with SQL Server Compact Edition Database

I've been looking into the following CodeProject article:
http://www.codeproject.com/KB/tips/CreateSQLDV.aspx
and I've been trying to figure out if I can get this to work both with standard SQL Server databases, as well as SQL Server CE databases.
I can create the Database object for a standard db that's on my server:
Server dbServer = new Server("myserver.com");
Database database = dbServer.Databases["MyDB"];
But I'm having my issues when in trying to create the object for a local, compact edition database:
Server dbServer = new Server("C:\PathToDb\MyDb.sdf");
Database database = dbServer.Databases["MyDB"];
I know that in most cases there isn't much overlap between SQL Server and SQL Server CE, but considering this is the SQL Server SDKs, and SQL Server Management Studio can connect to compact edition databases, I'm thinking there must be some way I'm overlooking...
There is no SMO for SQL Server Compact, to create databases, you can use the SqlCeEngine object. For othr scripting purposes, you can use my scripting API, http://exportsqlce.codeplex.com

Using microsoft sync framework 2.1 for SQL Server 2000

We need to synchronize database and image files between two servers. The source server has sql server 2000 and the destination server has sql server 2008. We need to synchronize data in some tables in sql server 2000 so that the updated data comes to sql server 2008 every once in a while. Similarly for the folder where images are stored.
I tried to implement Microsoft sync framework (http://msdn.microsoft.com/sync) with WCF to achieve the goal. I ran the following project successfully for two databases in SQL Server 2008:
http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208/sourcecode?fileId=19017&pathId=519811259
However, when I tried to synchronize data between database, one in sql server 2000 and sql server 2008, then I could not synchronize data.
Questions:
Is there anyway to synchronize data between sql server 2000 and sql server 2008?
If not, are there any other possible architectures i can implement to achieve the objective?
the minimum Sql Server version for the sync provider in the sample you used above is Sql Server 2005 SP2 (where min_active_version() was introduced.)
try using the steps in this link so you can overrride the commands and make them work against Sql 2000: Synchronizing Other ADO.NET Compatible Databases

Problem with importing an mdf created with SQL Server Express 2008 into SQL Server 2005

The question is probably extremely easy to resolve, but I need to resolve it because I need to carry on with my project. I am using SQL Server Express 2008 at home, and I've been working on an ASP.NET MVC app that stores my DB in an mdf file in the project's folder. The problem is that the SQL Server in the Uni labs is SQL Server 2005, and when I try to open the mdf file with the VS Server Explorer,It says that the version of the mdf file is more than the server can accept.
The only option that comes to my mind is exporting the DB as an sql file, just like I've done it thousand times with phpmyadmin. the thing is that the SQL Management Studio Express is not the most usable tool in the world, and for some strange reason all the articles I could find in Google were irrelevant. Please, help.
It is not possible to attach database created on SQL Server 2008 to SQL Server 2005. The other direction is possible.
Your only option is to script the database and data and run the scripts on SQL 2005. If you have used any of new features of the SQL Server 2008, you will have to rewrite the scripts.
I haven't used it much, but right click on database -> Tasks... -> Generate Scripts... / Export Data... / Import Data... should do the job right.
Google "Database Publishing Wizard", it's a tool from Microsoft to script an entire database, both schema and data.
you can script your db and its data. then run it on the target server to create a new db that is compatible with 2005 version.
Tools like Red-Gate SQL Compare and SQL Data Compare can compare a live database to e.g. a backup file, so you could compare your SQL Server 2005 database against the SQL Server 2008 Express backup file, and move data that way.
Or you could possibly generate INSERT statements for your tables that have changed data using a tool like this one here or this one here. These can generate INSERT scripts for your tables, which you can take along and run on your SQL Server 2005 target system.

Resources