Johnny posted on May 29, 2008 07:17

I have updated the SQL Server to Sql Server Compact Edition Database copy utility. A few users found a couple issues. Here is what was fixed or added.

-- Added the ability to select the schema you wish to copy. For most databases this will simply be "dbo".
-- Fixed a bug where the application did not recognize a valid version of "System.Data.SqlServerCe.dll".
-- Fixed an issue which limited the database size to 256Mb. The limit is now set to 4091Mb, the maximum size supported by SQL Compact Edition.
-- Fixed an issue where the application assumed a single column primary key. (courtesy of Ricardo Lopes)
-- Fixed an issue introduced in the lastround of fixes involving the ability to select the schema to use from SQL Server 2005. No schemas are available for a SQL 2000 database.  (courtesy of Ricardo Lopes)

 

 I have posted the new source code as well as the executable here.

 


Currently rated 3.7 by 3 people

  • Currently 3.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Related posts

Comments


May 29. 2008 10:13
Hi Scott - finally the long awaited data migration wizard! You can find full details of SQL Compact version numbers here: blogs.msdn.com/.../...ompact-release-versions.aspx

http://erikej.blogspot.com/


May 29. 2008 10:27
I have just done some testing, Scott.
You should not create timestamp fields when targeting version 3.1... (there may be other restrictions, I will test with a table containing all availabe SQL Server 2005 data types)

http://erikej.blogspot.com/


May 29. 2008 10:31
I did most of my testing targeting SQL Compact 3.5. I appreciate your additional testing. Just let me know what other field types are not supported so I can make the corrections to the code.



May 29. 2008 10:37
As far as the version numbers go... I updated the code so that it only checks the first 2 digits of the version so as long as you have 3.0 or 3.5 you should be good.



May 30. 2008 06:48
Hi, I have done more testing on the timestamp issue - selecting 3.5 as file format did not sole the problem, as the DLL loaded was always the 3.1! version.
I changed line 368 to:
if (outputCtrl1.SelectedVersion == SqlServerCompactVersion.ver31)

and can now create the table and proceed.

http://erikej.blogspot.com/


September 18. 2008 03:54
Thanks ... I have been looking for a tool for 2 days... I will test yours when I get at home... thanks again...


PS: I don´t have donate anything but I clicked in a few adsenses...

http://www.guilhermemorais.com/blog


September 25. 2008 12:27
Hi! Johnny....

unfortunately, I´m using varchar in my SQL Sever... so the convertion could work. in SQLCE the varchar is nvarchar...

How can we fix that?

http://www.guilhermemorais.com/blog


us dan
October 20. 2008 00:42
hi,

I attempted to convert a table that had a field set to varchar(7000) for its size. i received the following message

"the specified length is too long for the column type. [specified length = 7000, column data type = 8]"

i went in and modified the table so that it was set to varchar(max) and I still received the same message. Eventually i figured out the size of the largest piece of data in the one field and readjusted the size to varchar(3100) and this seemed to work.

I may be mistaken but from what i thought i read the original value of varchar(7000) should have worked.




us David Ward
December 3. 2008 10:55
As a suggestion for a future update... this tool seems to read in the entire database into memory before even starting the conversion. Not a problem with a small database, but right now I'm trying to convert a 1.3GB database, and my computer has been sitting here for an hour and I have no indication of how it's doing (SDF output file size is still 32KB, and physical and virtual memory usage are both relatively steady). Could it not read reasonable-sized chunks of records at a time, then turn around and write these out, and then flush those from memory and repeat?

I know you have graciously posted the source code and, if I wasn't trying to meet a project deadline, I would gladly try to do this myself. So just a suggestion for the next version. Thanks.




cn 560889223
December 4. 2008 06:31
hi,

As you said, I cannot create a foreign key constraint via Visual Studio 2008 or SQL Server Management Studio (along with MSSQL 2008). Is this just a limitation of VS and SSMS, or a limitation of SQL Server Compact Edition?




gb Dan
December 17. 2008 05:33
Hi

Any chance of a release of the sql db copy tool that works with sql ce 3.5 sp1?

Thanks,
Dan




py Roberto
December 24. 2008 02:36
Hello, I'd problems when converting databases with multi columns PKs, and with complex relationships, if you like, I´ve the code fixed. Just contact me.




ie David Loring
December 30. 2008 06:30
Got a load or error data when I first tried this out. I have the details if you wish to see them.




 Ian
January 8. 2009 00:41
Hi

Any chance of a release of the sql db copy tool that works with sql ce 3.5 sp1?

Thanks,
Dan


+1




it Filippo
January 12. 2009 09:57
Very useful tool but I suggest to include the smallmoney data type in the switch statement that performs the mapping from Sql Server to Sql Server CE data type:

case SqlDataType.SmallMoney:
col.DataType = new DataType(SqlDataType.Money);
break;




January 20. 2009 19:05
@dan- I am about to ask that question too. Is there any possibility to do that in sql 3.5?

http://inventorymanagementsoftwarezone.com/


ca Carlos de la Puente
February 2. 2009 06:37
Thanks for posting this utility. It has, however, been of no help to me. In regards to "-- Fixed a bug where the application did not recognize a valid version of "System.Data.SqlServerCe.dll," it seems it's not been fixed. When I select the assembly path for that dll, it comes back with "Wrong Version of Assembly! This does not appear to be the correct version." I'm running V3.5 SP1.




se Jacob
February 12. 2009 04:45
Hi Johnny! Maybe I've missed that info but does it work with Sql Server Express (2005)?




us k
March 30. 2009 05:31
Hey,

For the other SQL Server CE 3.5 SP1 people, I was able to get it to work by modifying SelectMobileAssembliesDialog.cs line 98 to:

if (ver.FileMajorPart == 3 && ver.FileMinorPart == 5)

Also, I ran into some issue in the FinishCtrl.cs trying to update the progress bar based on the number of rows. As I was only using this for a POC, I didn't debug it (I think my data made it! ;) and instead hacked lines 58&59 to say:

progressBar1.Maximum = Math.Max( value, max );
progressBar1.Value = Math.Min( value, max );

Other than that it worked great! Thank you very, very much for developing this tool, and for releasing the source to the community.




us k
April 2. 2009 05:45
For the other SQL Server CE 3.5 SP1 people, I was able to get it to work by modifying SelectMobileAssembliesDialog.cs line 98 to:

if (ver.FileMajorPart == 3 && ver.FileMinorPart == 5)

Also, I ran into some issue in the FinishCtrl.cs trying to update the progress bar based on the number of rows. As I was only using this for a POC, I didn't debug it (I think my data made it! ;) and instead hacked lines 58&59 to say:

progressBar1.Maximum = Math.Max( value, max );
progressBar1.Value = Math.Min( value, max );

Other than that it worked great! Thank you very, very much for developing this tool, and for releasing the source to the community.




ru Igor
May 28. 2009 17:05
Another piece:
public void UpdateProgressBar(int value, int max)
{
progressBar1.Maximum = max;
progressBar1.Value = value>=max?max:value;

no idea why but it dropped with max=569 and value=570




us SEO
June 29. 2009 00:33
Nice post.I’m really impressed with your article, such great information you mentioned here..

http://www.webmarketingexperts.com.au/


us Martin
July 3. 2009 10:42
Thanks a lot for the tool. I have a beginner's problem, maybe you can help. When starting up the tool asks for assembly files. I don't really know what those are and the file open dialog box just says "System.Data.SqlServerCe". I can't find this file, nor the mentioned "System.Data.SqlServerCe.dll". I have VC# Express 2008 installed which seems to have come with a bunch of SQL server installations. But when I search the disk for the DLL I can't find it. I would like to import a SQL server database (or just the schema) into my little development environment. I have added a database to my project as a .sdf file.
Thanks!




us Martin
July 3. 2009 10:51
I gave up to quick. I found the DLL(s) at

C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5

but the 3.5 version comes up with an error box "this does not appear to be the right version" and the 3.1 version works, but then throws an exception in the tool. Any clues?


System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at GLT.SqlCopy.WizardForm.btnNext_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
GLT.SqlCopy
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Martin/code/applications/DataLoader/copytool/GLT.SqlCopy.exe
----------------------------------------
System.Windows.Forms





July 8. 2009 20:59
How to handle the exceptions in SQL Server 2000?

http://www.lowcostlifeinsurance.co.uk/


July 17. 2009 22:21
what is the right order to install SQl server and visual studio?

http://www.ratedetective.com.au/


August 6. 2009 04:27
Health insurance is insurance that pays for medical expenses. It is sometimes used more broadly to include insurance covering disability or long-term nursing or custodial care needs. It may be provided through a government-sponsored social insurance program, or from private insurance companies.

http://www.awm-commercial-mortgages.co.uk/


September 20. 2009 23:21
How to input more data(ex different material name)in a single columnthrough sql command?

http://www.logicalblueone.com.au/store/


October 1. 2009 10:46
i have been looking for this kind of post since thanks

http://www.ultimatenurse.com/


October 15. 2009 00:30
Interesting ... as always - is your blog making any cash advance ? ;)

http://fastloansus.com/


October 15. 2009 22:10

Very helpful info, especially for those of us that are technically challenged.

http://www.1300insurance.com.au/car/


October 15. 2009 23:06
Easy option to get useful information as well as share good stuff with good ideas and concepts

http://www.ratedetective.com.au/insurance/life-insurance


October 18. 2009 18:52
Thank you for your help!

http://direct-payday-cash-advance.com/


October 18. 2009 22:54

There are certainly a lot more details to take into consideration, but thanks for sharing.

http://www.ratedetective.com.au/home-loans


October 20. 2009 15:26
I loved the way you exlained things. Much better many here


Regards

krich off


http://www.eing.com/


us waggi
October 21. 2009 20:34
Great post.




October 21. 2009 20:36
Thanks fro sharing on how to work on SQL but there are new latest release of SQL and I don't know how to work on it.

http://www.legalwill.com.au/


October 21. 2009 21:16
Simply wanted to express my gratitude to everybody who has anything to do with the creation of this resource. I wish I could find such informative sites more often. I regularly spend much time on lust looking for some worthy sites when I can find something to read. Your site is surely one of them. I wish you futher success.

http://www.1300insurance.com.au/home_insurance/


October 22. 2009 00:45
Nice post.I like the way you start and then conclude your thoughts. Thanks for this information .I really appreciate your work, keep it up

http://www.ratedetective.com.au/insurance/income-protection


October 22. 2009 21:26
Useful information shared..Iam very happy to read this article..thanks for giving us nice info.Fantastic walk-through. I appreciate this post.

http://green-tea-health-benefits.greenteaweightloss.net/


October 23. 2009 02:26
The info shared by you in this blog is really awesome..U have done good work in this site..Keep going...

http://www.budwigcenter.com/anti-cancer-diet.php


us Emo
October 25. 2009 03:37
Simply wanted to express my gratitude to everybody who has anything to do with the creation of this resource. I wish I could find such informative sites more often. I regularly spend much time on lust looking for some worthy sites when I can find something to read. Your site is surely one of them. I wish you futher success.

http://www.emo-site.com/

Search Blog Post

Follow me on

Twitter Updates

    Recent Comments

    Disclaimer
    The opinions expressed herein are my own personal opinions.

    © Copyright 2010 Johnny Can't Code