How to import data in SQL Compact Edition?

Peter picture Peter · Oct 6, 2009 · Viewed 23.4k times · Source

I don't seem to find a tool for it, nor an odbc driver.

Thanks

UPDATE : I'm aware of the sql scripting possibilities. But than again : how to script a sql 2k table? (not just ddl, but data also?)

Of course you can write this all by yourself, but importing data into CE cannot be such a hassle, or can it ?

UPDATE2 : I don't seem to be able to choose the right dialect for inserting

Answer

Julien Lebosquain picture Julien Lebosquain · Oct 6, 2009

You can use SQL Server Management Studio Express which also allows the connection to SQL Compact databases. You'll then be able to execute any *.sql file easily that have data exported from elsewhere.

Edit (response to update): I don't know if you can connect to a SQL Server 2000 with SSMS 2008, but if you can, right click on your database in SSMS, choose Tasks > Generate Scripts, and in the options on the second page, scroll down and change "Script Data" to True.