问题
I have created program that uses SQL Server database to store data. After a while (and lots of stored data) I have realized I don't need database on the server, local database running without server could do the job.
Now I need some advice how to export, convert or whatever, SQL Server database to local (sdf) database? I'm using VS 2010 and SQL Server 2008, I also have SQL Server Management Studio.
回答1:
Check out the SQL Server to SQL Server Compact Edition Copy Tool available on CodeProject in C# source code:

Should do just what you need: copy data from SQL Server to a SQL Server Compact Edition .sdf file.
回答2:
Use the Export database tool? If you are using MS Windows OS then you can access is through the JET interface.
回答3:
Use my Export2sqlce.exe command line utility: http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html
来源:https://stackoverflow.com/questions/7555006/converting-sql-server-database-to-local-c-sharp-database