Skip to main content
Email Password   helpLost your password?

UPDATE:

Please download the latest version of this tool from JohnnyCantCode.com. I have updated this utility based on some feedback from users.

I added the ability to select the schema you wish to copy. For most databases this will simply be "dbo".

I fixed a bug where the application did not recognize a valid version of "System.Data.SqlServerCe.dll".

Introduction

This utility will copy the schema and data from a normal SQL Server 2000/2005 database and export it to a SQL Server Compact Edition database. The tool supports version 3.1 or 3.5 of SQL Server Compact Edition.

Background

I was working on a mobile application and needed and easy way to manage the table relationships and indexes without having to resort to scripting. I was familiar with using SQL Server Management Studio so I decided that I would write a utility that converted a normal SQL Server database to a mobile database. This way I could continue using the tool I normal use to create and maintain my databases.

Using the code

Feel free to take a look at the code and offer your most gracious comments. The application uses a wizard to walk you through converting a database. I have also included a normal WINFORM that does the conversion also but I stopped development on this in lieu of the wizard so the form is incomplete. I will be maintaining this code and writing more about it on my blog at www.JohnnyCantCode.com. You can find the original post here.

Points of Interest

This utility will copy Indexes, Primary Keys, Foreign Keys, Table structure and data. SQL Server Compact Edition does not have support for Views, Triggers nor Stored Procedures, therefor this utility does not copy these.

History

1.0 Initial release

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralFor SQL Server CE 3.5 SP1 Pin
kshakir
11:08 23 Jul '09  
QuestionSql 2008 support? Pin
khanricksteele
8:26 29 Apr '09  
QuestionUnknown datatype Pin
Member 1871253
0:38 19 Mar '09  
AnswerRe: Unknown datatype Pin
Member 2651573
7:32 16 Jun '09  
GeneralPrimery Keys are not correct after import to SQL Compact Pin
voellinger
1:51 26 Jan '09  
GeneralOut of memory error Pin
cess
10:36 30 Nov '08  
Generalthere is problem with NVARCHAR(MAX) Pin
Tajniak5
6:51 20 Nov '08  
Generaliv been messing with this for a while until i found this.TNX!!!!! Pin
zivzuv
21:37 18 Nov '08  
Generalprimary key contraint names Pin
mape1082
6:04 19 Aug '08  
GeneralRe: primary key contraint names Pin
Francois YACOB
7:38 16 Jun '09  
GeneralThis thing rocks! Pin
sholliday
11:32 5 Aug '08  
GeneralGreat work!!! only one thing and an Idea for future work Pin
mape1082
7:19 23 Jul '08  
GeneralRe: Great work!!! only one thing and an Idea for future work Pin
Francois YACOB
7:43 16 Jun '09  
GeneralType Conversion errors Pin
gratajik
14:25 15 Jul '08  
GeneralON DELETE ... ON UPDATE ... Pin
Hoang Cuong
23:21 12 Jul '08  
Generaldata transfer Pin
Shaikh Sahrif
20:18 28 Jun '08  
GeneralBrilliant Pin
Johnny J.
21:44 26 Jun '08  
GeneralError after conversion.. Opening converted file with SQL Management Studio Pin
mGxAlander
18:46 5 Jun '08  
GeneralRe: Error after conversion.. Opening converted file with SQL Management Studio Pin
johnnycantcode
10:34 12 Jun '08  
GeneralNot working with SQL2000 Pin
oldieman
23:28 2 Jun '08  
GeneralVisual Studio Pin
gnassar
3:26 2 Jun '08  
GeneralRe: Visual Studio Pin
johnnycantcode
10:35 12 Jun '08  
GeneralSchema Setting + SqlCe Version Pin
Charl Victor
0:27 13 May '08  
GeneralRe: Schema Setting + SqlCe Version Pin
johnnycantcode
4:22 13 May '08  
AnswerRe: Schema Setting + SqlCe Version Pin
Charl Victor
6:17 14 May '08  


Last Updated 26 Jun 2008 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009