Exporting from SQLite to SQL Server Exporting from SQLite to SQL Server sql-server sql-server

Exporting from SQLite to SQL Server


SQLite does have a .dump option to run at the command line. Though I prefer to use the SQLite Database Browser application for managing SQLite databases. You can export the structure and contents to a .sql file that can be read by just about anything. File > Export > Database to SQL file.


I know that this is old thread, but I think that this solution should be also here.

  • Install ODBC driver for SQLite
  • Run odbcad32 for x64 or C:\Windows\SysWOW64\odbcad32.exe for x86
  • Create SYSTEM DSN, where you select SQLite3 ODBC Driver
  • Then you fill up form where Database Name is filepath to sqlite database

Then in SQL Server run under sysadmin

USE [master]GOEXEC sp_addlinkedserver    @server     = 'OldSQLite', -- connection name   @srvproduct = '',          -- Can be blank but not NULL   @provider   = 'MSDASQL',    @datasrc    = 'SQLiteDNSName' -- name of the system DSN connection GO

Then you can run your queries as normal usere.g.

SELECT * INTO SQLServerDATA FROM openquery(SQLiteDNSName, 'select * from SQLiteData')

or you can use something like this for larger tables.


The SQLite .dump command will output the entire contents of the database as an ASCII text file. This file is in standard SQL format, so it can be imported into any SQL database.More details on this page: sqlite3