简体   繁体   中英

How Can I Import Data From Sql Server CE DataBase File To Excel?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM