Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to export SQL Server database to sqlite (or SQL Server Compact)

Do someone know what would be the best way to transform a big SQL Server database to sqlite or SQL Server compact ?

SQL Server database should be around 50-70Gb.

There are some examples on internet (script schema) but I didn't find anything concluding about data.

like image 397
Ronan Lamour Avatar asked Sep 26 '14 10:09

Ronan Lamour


People also ask

Is SQLite faster than SQL Server?

SQLite is generally a lot faster than MS SQL Server if dealing with small-size databases. SQLite can be integrated with different programming languages and environments including . NET. However, SQLite has poor support for multi-threading.

What replaced SQL Server Compact?

There are three alternatives to Microsoft SQL Server Compact for a variety of platforms, including Windows,. NET Framework, Android, iPhone and Linux. The best alternative is SQLite, which is both free and Open Source. Other great apps like Microsoft SQL Server Compact are CompactView and SQL Compact Query Analyzer.

Should I use SQLite or SQL Server?

Microsoft SQL Server is a powerful, full featured SQL system that supports entire ecosystems. While SQLite is a light-weight database meant to be embedded into end programs. SQLite is often useful even to SQL Server professionals when they need to create smaller databases without a full server setup to support.

Is SQLite good for large databases?

Very large datasets An SQLite database is limited in size to 281 terabytes (248 bytes, 256 tibibytes). And even if it could handle larger databases, SQLite stores the entire database in a single disk file and many filesystems limit the maximum size of files to something less than this.


1 Answers

You can use my Exportsqlce tool to create .sql files in sqlite format from a SQL Server database. Then run them using sqlite3.exe

Download command line tools from https://github.com/ErikEJ/SqlCeToolbox/releases/tag/3.5.2

Export2SQLCE.exe "Data Source=(local);Initial Catalog=Northwind;Integrated Security=True" Northwind.sql sqlite

Good luck!

(I also have SSMS and VS extensions that allow you to do this from a GUI)

like image 65
ErikEJ Avatar answered Oct 14 '22 21:10

ErikEJ