tags:

views:

44

answers:

1

Hi

How Can I Import Data From a Table in Sql Server CE To Excel? I Try This From Excel But I Can Not Find an Item for This In Excel

Please Help Me To This

+1  A: 

You can try the sqlcecmd command from the command line.

sqlcecmd -d "Data Source=C:\NW.sdf" -q "SELECT * FROM my_table" -h 0 -s "," -o my_data.csv

Of course you need to specify the correct location of your Data Source in the -d command

You need to specify the cells you wish to SELECT and the table in the FROM section of the -q command.

The "-h 0" flag will remove column names and any dashed lines.

The "-s ','" specifies the delimiter you wish you use between fields.

And finally the -o command specifies your output file.

You may also need to specify a username (-U) and password (-P) if these values have been set.

Before you can run the sqlcecmd you will need to make sure that the executable files for SQL Server CE are in your path.

Since you haven't specified a programming language i'm assuming you are doing this manually.

After you have the csv file excel should be able to open it no problem.


EDIT: If you do not have the SQLCECMD application then download and set it up first.

gruntled