Solved

copy database from sql 2008 to sql 3.5

Posted on 2011-03-13
11
537 Views
Last Modified: 2013-12-27
I want to copy database (table structre and records) from sql server 2008 R2 into SQL Compact edition 3.5.

I use Visual Studio 2008 Professional and Windows Mobile Device Center in development. The device is running Windows 6.1.
0
Comment
Question by:smetechit
  • 7
  • 4
11 Comments
 
LVL 16

Accepted Solution

by:
hjgode earned 500 total points
ID: 35135098
Hello

my first suggestion is to have a sql server 2008 connection and a local sqlce database on the device and then just query the schema and data of the sql2008 server and built up the sqlce database with this data.
On windows mobile with sqlce you can have a local sqlce database (single file with sdf extension) or connect directly to a sql server (2000/2005/2008) using TCP/IP. This would work also with ActiveSync or WMDC connected windows mobile device, as there is passthru support.

Another approach is offered at http://www.codeproject.com/KB/database/SqlCompactCoptUtility.aspx where a desktop appication does convert a sql2005 database to sqlce formatted sdf file.
As sql server 2005 and 2008 should not differ from connection based view, the code should work for sql server 2008 too.

If you use sqlce other than 3.0 and 3.5, you have to change the code to meet your sqlce assemblies version numbers in the code that checks the sqlce assemblies.

Does this help you?

Josef
0
 

Author Comment

by:smetechit
ID: 35135622
Hi hjgode,

I tried the copy utility but it throughs the attached errors , I am not sure if these errors are related to sql server version (I use 2008 but the utility is designed for sql 2005/2000).

Regarding your first suggestion, can you elaborate more how can I add connection to sql 2008 into device and copy the database, I am using Windows Mobile Device Center.

Error.png
Error.txt
0
 
LVL 16

Expert Comment

by:hjgode
ID: 35138853
It is missing a file. Unfortunately I cant read the first line of the JIT exception dialog. As far as I can see, it is looking for MSSql server assembly.

Do you have Sql Server Management Studio installed?

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 16

Expert Comment

by:hjgode
ID: 35140883
The required DLLs (assemblies) are part of Microsoft SQL Server 2008 R2 Shared Management Objects from the Feature Pack.
0
 

Author Comment

by:smetechit
ID: 35147515
The complete errors are listed in the previously attached text file.

0
 
LVL 16

Expert Comment

by:hjgode
ID: 35149752
Hello

sorry for that, I did not relaize that a txt file was also attached.

But as said, you have to install the SQL Server Management Objects (SMO) of the Feature pack: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ceb4346f-657f-4d28-83f5-aae0c5c83d52

Look for "Microsoft® SQL Server® 2008 R2 Shared Management Objects"
0
 

Author Comment

by:smetechit
ID: 35154121
Hi higode,

I have installed SMO but the error is still existing.
0
 
LVL 16

Expert Comment

by:hjgode
ID: 35157528
I have done an installer for this. Hopefully you are now more successfull. AFAIK only basic types can be copied.

http:// www.hjgode.de/temp/SqlCopy-Release.zip

You still need Microsoft SQL Server Compact 3.5 Service Pack 2 for Windows Desktop
0
 
LVL 16

Expert Comment

by:hjgode
ID: 35163100
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e497988a-c93a-404c-b161-3a0b323dce24

is the link to Microsoft SQL Server Compact 3.5 Service Pack 2

the latest version of the tool is sited at http://www.johnnycantcode.com/page/SQL-Server-to-SQL-Server-Compact-Edition-Database-Copy.aspx

Please let me know, when you downloaded the installer (it installs runtimes too!). Then you may copy the latest exe into the install dir (Program File\Ich...)
I will then delete the installer of my webspace

regards

Josef
0
 
LVL 16

Expert Comment

by:hjgode
ID: 35164237
Hello again

I found one more possible solution: http://www.primeworks-mobile.com/Products/DataPortWizard.html

0
 

Author Comment

by:smetechit
ID: 35204741
The software in the link causes my intermec cn50 device to stop booting Windows and I had to clean boot ir.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question