0

I'm trying to convert a SQL Server 2008 R2 database to SQL Server CE 4.

The only solution I can find is detailed here: http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html.

However, I've downloaded the .exe and opened it - it just pops up with a command window which says something then immediately closes before I can read it; which I assume is just it installing.

However, if I then open a command prompt and type any of the instructions in that example and run e.g.

Export2sqlce "Data Source=(local);Initial Catalog=AdventureworksLT;Integrated Security=True" AW.sqlce

I just get "'Export2sqlce' is not recognized as an internal or external command, operable program or batch file."

What am I doing wrong?

EDIT: I needed to run the full path to the exe and the extension for it to work. Like this:

C:\Users\admin\Desktop\Export2SQLCE.exe "Data Source=(local);Initial Catalog=Northwind;Integrated Security=True" Northwind.sql
Dan
  • 5,836
  • 22
  • 86
  • 140
  • 2
    To see what the output is, open a command window and run the exe manually by command line, instead of double-clicking on it. This will prevent the command window from disappearing after the command finishes. – Aaron Bertrand Jul 06 '11 at 16:06
  • C:\Users\admin>C:\Users\admin\Desktop\Export2SqlCE.exe Usage : Export2SQLCE.exe [SQL Server Connection String] [output file location] [[schema only]] [[saveimages]] (schemaonly and saveimages are optional parameters) Examples : Export2SQLCE.exe "Data Source=(local);Initial Catalog=Northwind;Integrated Secu rity=True" Northwind.sql Export2SQLCE.exe "Data Source=(local);Initial Catalog=Northwind;Integrated Secu rity=True" Northwind.sql schemaonly Server data types currently NOT supported: sql_variant C:\Users\admin> – Dan Jul 06 '11 at 16:19
  • 1
    Well, looks like that tool isn't going to work, because it doesn't support SQL_VARIANT. – Aaron Bertrand Jul 06 '11 at 16:22
  • I'm not sure what that means - the tool is specifically for converting SQL Server to SQLCE, so I'm not sure why it would not work (lots of people on codeplex etc seem to have used it without any issues). Is it something related to my dev environment? – Dan Jul 06 '11 at 16:26
  • No, it is probably because not a lot of people use SQL_VARIANT. Have you mentioned this issue to the author of the tool? – Aaron Bertrand Jul 06 '11 at 16:37
  • Hi Aaron, I am the author, and have never had anyone asking for support for SQL_VARIANT before. What data type do you suggest I convert SQLVariant columns to? – ErikEJ Jul 06 '11 at 18:16
  • 1
    The tool has now been updated to ignore sql_varinat columns – ErikEJ Jul 29 '14 at 10:08

1 Answers1

2

For any command lin utility, you must either locate yourself to the folder where it resides, use the full path or place the file in a folder that is in the PATH environment variable.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115