Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

copy database from sql 2008 to sql 3.5

Posted on 2011-03-13
11
538 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I think the most popular question in our Windows Mobile Programming zone is about the backlight - we all want to keep it on when our application is running. Few years ago the function SystemIdleTimerReset() did this job. On our side we had to detec…
When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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