views:

414

answers:

1

How can I copy a table from an SQL Server CE 3.5 database to another (also CE database) in Visual Studio 2008, using the design tools?

Note: When right clicking on a table there is a "copy" command, but I couldn't find any "paste" command so far...

+4  A: 

Whether by intent or not, Microsoft has made it difficult to perform common tasks with SQL Server CE 3.5.

Here is a way to do what you are looking for:

  1. Close SQL Server Management Studio (SSMS) if it is open. (don't skip this)
    1. If you don't have SSMS you can download the express version which should work fine for this.
  2. Go to http://exportsqlce.codeplex.com/
  3. Down load and install that extension.
  4. Start SSMS
  5. Connect to database you want to copy from
  6. Right Click on the table you want to copy and select "Scrip table As"->"Create to"->"New Query Window" alt text
  7. Copy the text created.
  8. Connect to your db you want to copy to.
  9. Open a Query Window and paste and run the create script.

This tool also supports scripting the table inserts (if you want to copy the data):

alt text

Vaccano
Thank you Vaccano. Super! SSMS does the job!
ileon