Now the first problem that I had : How to migrate the tables along with the data from SQL CE 3.5 to SQL Server Express?

I have been googling around for a while, but haven't really found a good one for this, which make me realized that there are more ways to get the data from SQL Server to SQL CE but not the other way around duhh :|

So later, I decided to code it myself ;)

When browsing around the net, I found about Information Schema View that is available in SQL Server, and fortunately it is also available in the SQL CE 3.5 ;) (before I found out about the view, I was using Linq Attributes to generate the table creation ouccch)So now by using the view, I generate the script for the SQL CE 3.5 database file (.sdf).

In summary, the code will :1. Generate Table Creation Script2. Generate Insert Statement for the data in all of the tables3. Generate script to assign the Primary Keys for the tables4. Generate script to assign the foreign keys / references for the tables

** Update 5. Generate script to assign Indexes for the tables

6. Save the script into the output file

So here's a little peek of how to use the tool, I'm using Northwind.sdf file in the example below :There are 2 parameters to pass in ;1. Connection String to the sdf file2. Output File Name for the script

Note : If you get any access denied when trying to open the Northwind.sdf file, here is why and the solution.

After the Northwind.sql file has been generated :1. Create the SQL Server database file (.mdf)2. Open the Northwind.sql script into your SQL Server Management Studio or Visual Studio (Since I'm currently using SQL Epxress 2008 CTP, there is no management studio yet for now) and just execute them, if everything's ok (finger crossed), you will see this kind of message below and you're done :)

Please note :1. The tool will not generate the database for you, it will only generate the scripts to execute2. Currently I purposely convert nchar and nvarchar data type to varchar in the table creation script. I don't see any purpose of using them unless if storing unicode characters in the table.3. I haven't handled Image / BLOB data type for generating data (Insert Statement).

Ok now, stop talking and just give me the download link :P

Here is the executable file :**Removed: Please get the files from CodePlex site instead.

And here is the code, if you want to see what's running inside :**Removed: Please get the files from CodePlex site instead.

**Updates: Erik EJ has provided the newer version of this at CodePlex website, I really recommend that you get the files from there. Huge thanks to Erik to make this utility tool better and to make it possible for others to contribute

Hope it helps ;)and do leave a comment if you have any feedback or find any bugs, Thanks ;)

Hi Bembeng, can I reuse your code in a project I'm planning? I would like to enhance your code with the current missing features and make the resulat available as a OpenSource project. The features I am planning to add include: nchar/nvarchar use, ntext and image support (for INSERTs), support for scripting ROWGUIDCOL property, scripting defaults.

i have been looking for something like this for ages.. thanks man... i have one problem tho. i have a database about 95MB and tried to generate the sql script but as soon as it gets to the generating the foreign keys step the application crash and i get OutOfMemoryException although i have 3GB of RAM 2GB free!

PPC Expert For Tech Support | inbound calls for tech support, pop up calls for tech support Call at: +91 981-142-0083 ppc management experts ppc call provide by osiel webPPC Promotion and marketing is very important to get the business for professional company especially for Tech Support & web design company.Google Adwords For Tech SupportPPC Expert For Tech SupportInbound Technical Support call | Call at: +91 981-142-0083 | inbound calls for tech support tech support inbound calls A great online marketing company for tech support inbound calls, Inbound Technical Support call by osiel web