---
title: "Migrate SQLite to SQL Server in your browser"
description: "Migrate a SQLite database to SQL Server: convert the .db file or its dump into a script with the same tables, keys and data, and a report of every change."
canonical: https://intosql.com/sqlite-to-sql-server
last_updated: 2026-10-15
---

# Migrate SQLite to SQL Server in your browser

Drop a SQLite database file (.db, .sqlite, .sqlite3) or the SQL that sqlite3's .dump writes, and download a script for SQL Server with the same tables, keys, indexes and data. Each column gets the type its values fit, and every value SQL Server can't hold as it is is listed in the report.

[SQLite to SQL Server migration guide](https://intosql.com/docs/migrations/sqlite-to-sql-server)

[SQLite to SQL Server data types](https://intosql.com/docs/types/sqlite-to-sql-server)

## What changes from SQLite to SQL Server

Each row is a rule the converter applies, with the report line it writes when the rule changes something in your data.

| In SQLite | In SQL Server | Report line |
| --- | --- | --- |
| declared types (any text: VARCHAR(255), DATETIME, BOOLEAN, JSON or none) | the type every value in the column fits |  |
| BOOLEAN, BOOL | bit |  |
| TEXT, VARCHAR(n), CHAR(n), CLOB | nvarchar(n) or nvarchar(max) |  |
| DECIMAL(p,s), NUMERIC | the exact type when every value fits it, else a double |  |
| BLOB, and columns holding bytes | varbinary(max) |  |
| DATE, DATETIME, TIMESTAMP holding ISO 8601 text | date, datetime2(p) |  |
| JSON holding JSON text | nvarchar(max) |  |
| Infinity in REAL columns | NULL | `invalid_value_null` |
| INTEGER PRIMARY KEY, AUTOINCREMENT | IDENTITY, continuing after the highest id or sqlite_sequence's |  |
| COLLATE NOCASE | a case-insensitive collation |  |
| generated columns | computed columns, PERSISTED when STORED |  |
| generated columns with functions IntoSQL doesn't write, and the || operator | a plain column | `generated_not_translated` |
| defaults with functions IntoSQL doesn't write (strftime, randomblob) | no default | `default_not_translated` |
| CHECK constraints | translated |  |
| CHECK constraints with functions IntoSQL doesn't write | not created | `check_skipped` |
| partial and expression indexes | not created | `index_skipped` |
| foreign keys (unenforced unless PRAGMA foreign_keys=ON) | after the data WITH NOCHECK, then checked |  |
| ON DELETE or ON UPDATE that cascades in a cycle or along a second path | NO ACTION | `foreign_key_action_dropped` |
| VARCHAR(n) holding characters past U+FFFF (emoji) | nvarchar(2n), or nvarchar(max) past 4000 | `text_length_widened` |
| foreign keys to tables the dump doesn't create | not created | `foreign_key_skipped` |
| primary keys holding NULL, and NOT NULL columns with values that become NULL | NOT NULL dropped | `not_null_relaxed` |
| views, triggers and virtual tables (FTS, R*Tree) | listed in the report | `not_converted_objects` |
| dumps without CREATE TABLE (--data-only) | types read from the values | `no_schema` |
| expressions in INSERT values other than the text functions dumps write | NULL | `expression_value` |
| NUL characters in text | kept |  |
| text that isn't valid UTF-8 | the bad bytes as the replacement character | `invalid_utf8_replaced` |
| text decoded twice (Ã±) | copied as it is | `mojibake_suspected` |

## Load the script into SQL Server

The script creates the tables, copies the rows, then adds keys, indexes and foreign keys, so it loads fast and stops at the first error.

```shell
sqlcmd -b -f 65001 -S localhost -d mydb -i sqlite.sql_server.sql
```

Foreign keys are added WITH NOCHECK and then checked. If a row points to a row that doesn't exist, the script says which constraint and leaves it unchecked, instead of failing half way.

For a large dump, run sqlcmd on the same machine as the server. Each batch of up to 1000 rows commits on its own, so the transaction log stays small.

## Dump SQLite for the best result

The converter reads what the dump holds. These options keep more of your data in it:

- The database file itself converts as it is, read page by page in your browser. Close the app that writes to it first, so no change is left behind in its -wal file.
- sqlite3 app.db .dump > app.sql writes the same database as SQL, which converts too, as .sql or .sql.gz.
- DB Browser for SQLite writes that SQL with File, Export, Database to SQL file, and so does Python's iterdump().

## What isn't converted

Views and triggers are written in SQLite's own language. They are listed in the report by name, never dropped silently, so you can rewrite them for SQL Server. Virtual tables, such as FTS5 and R*Tree, are listed too, and their shadow tables are left out.

## Questions about SQLite to SQL Server

### Is my dump uploaded?

No. The converter runs in your browser and reads the dump from your disk in pieces, so it never leaves your computer. The desktop app and the command line convert on your computer too.

### How large can the dump be?

The converter never holds the whole dump in memory: it reads the file twice, by ranges, and writes the script as it goes. Multi-gigabyte dumps convert in the browser, in the desktop app and with the command line.

### Can I convert the .db file itself?

Yes. Drop the .db, .sqlite or .sqlite3 file: it is read in your browser and never uploaded. Text with NUL characters and every digit of a double arrive as stored, which a .dump can cut short.

### Which SQLite versions can the dump come from?

Database files from SQLite 3.0 on, in UTF-8 or UTF-16, and dumps from the sqlite3 shell's .dump or Python's iterdump(). Every test file and dump comes from sqlite3 3.31 to 3.54, STRICT and WITHOUT ROWID tables included, and is compared with its source cell by cell.

### How are column types decided when SQLite doesn't enforce them?

The declared type is a hint and the values decide: a column becomes bigint, decimal, float, date, datetime2, bit, varbinary or nvarchar when every value fits it. Text compares exactly, as in SQLite, and COLLATE NOCASE ignoring case.

### Are INTEGER PRIMARY KEY and AUTOINCREMENT kept?

Yes. An INTEGER PRIMARY KEY becomes an IDENTITY column, every row keeps its id, and the next id continues after the highest one, or after sqlite_sequence's value with AUTOINCREMENT.

### What about views and triggers?

They are listed in the report by name and not converted, because each database writes them in its own language.

### Which SQL Server versions does the script load on?

SQL Server 2017 to 2025. The same script loads on each of them, stopping at the first error if anything goes wrong.

## From SQLite

- [SQLite to PostgreSQL](https://intosql.com/sqlite-to-postgresql)
- [SQLite to MySQL](https://intosql.com/sqlite-to-mysql)
- [SQLite to MariaDB](https://intosql.com/sqlite-to-mariadb)
- [SQLite to SQLite](https://intosql.com/sqlite-to-sqlite)
- [SQLite to Oracle](https://intosql.com/sqlite-to-oracle)

## Into SQL Server

- [MySQL to SQL Server](https://intosql.com/mysql-to-sql-server)
- [MariaDB to SQL Server](https://intosql.com/mariadb-to-sql-server)
- [PostgreSQL to SQL Server](https://intosql.com/postgresql-to-sql-server)
- [SQL Server to SQL Server](https://intosql.com/sql-server-to-sql-server)
- [Oracle to SQL Server](https://intosql.com/oracle-to-sql-server)

## Guide and every pair

- [SQL Server to SQLite](https://intosql.com/sql-server-to-sqlite)
- [SQLite to SQL Server migration guide](https://intosql.com/docs/migrations/sqlite-to-sql-server)
- [SQLite to SQL Server data types](https://intosql.com/docs/types/sqlite-to-sql-server)
- [Every database pair](https://intosql.com/database-migration)
