Exporting SQL Compact Database to SQL Server

In this Section i wil show you how easily you can export your SQL Compact server database(.sdf File) to your local or online SQL Server.

Firts of all a big compliment to Erik Ejlskov.

With his Visual Studio Add-in "SQLCeToolBoox" you can attach your .sdf database to Visual Studio and export it from there to your remotly connected SQL Server

Github repository: https://github.com/ErikEJ/SqlCeToolbox

Download Source: https://visualstudiogallery.msdn.microsoft.com/0e313dfd-be80-4afb-b5e9-6e74d369f7a1/


After downloading and installing the Add-in just restart your Visual Studio.

Now you should see a new Explorer "SQL Server Compact/SQLite Toolbox"

If you don't find the explorer. Just check on the top menu bar "Window" and find the new explorer.



If your sdf database is binded to a project, just open the project. Else browse for the .sdf file.




After this, go back to your Server Explorer and bind the source Database. 



Now fill in your connection data and connect to the database, where you want to export the database schema including the data



Switch back and right click on the sdf you want to export. select "Script Database for SQL Server"




Now you should be able to select the source database to which you connected 2 steps before.


Now just click "Export". After a few seconds the wizard should finish successfully.


If this post was helpful, dont forget to leave a message.

Chears !




Caglar Tasci

Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defence against complexity. — David Gelernter

comments powered by Disqus