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

# Migrate SQL Server to SQLite in your browser

Drop the script SSMS's Generate Scripts writes with schema and data, as .sql or .sql.gz, UTF-16 or UTF-8, and download a script for SQLite with the same tables, keys, indexes and data. Every value SQLite can't hold as it is, and every object it doesn't carry, is listed in the report.

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

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

## What changes from SQL Server to SQLite

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

| In SQL Server | In SQLite | Report line |
| --- | --- | --- |
| bit | INTEGER 0 or 1 with a CHECK |  |
| tinyint | INTEGER with a CHECK that it isn't negative | `unsigned_widened` |
| char(n), varchar(n), nchar(n), nvarchar(n), varchar(max), text | VARCHAR(n) and TEXT, not enforced |  |
| decimal(p,s) past 15 digits, money | TEXT | `decimal_as_text` |
| date, datetime, datetime2, smalldatetime | DATETIME as ISO 8601 text, every digit kept |  |
| datetimeoffset | TIMESTAMP as ISO 8601 text in UTC | `moments_as_utc` |
| time | TIME as text |  |
| dates that aren't valid | NULL | `date_out_of_range` |
| json (SQL Server 2025) | TEXT |  |
| uniqueidentifier | TEXT |  |
| binary, varbinary, image | BLOB |  |
| geometry, geography | BLOB with SQL Server's own bytes | `spatial_as_native` |
| rowversion, timestamp | BLOB, empty | `rowversion_empty` |
| xml, sql_variant, hierarchyid, vector | TEXT | `type_replaced` |
| collations that ignore case (_CI_) | exact comparison | `case_insensitive_collation` |
| IDENTITY | INTEGER PRIMARY KEY AUTOINCREMENT, continuing after the highest id |  |
| IDENTITY columns that aren't the whole primary key | INTEGER without a counter | `counter_dropped` |
| CREATE SEQUENCE | not created | `sequence_not_converted` |
| computed columns | GENERATED ALWAYS AS, STORED when PERSISTED, VIRTUAL otherwise |  |
| computed columns with functions SQLite lacks | a plain column | `generated_not_translated` |
| defaults with functions SQLite lacks, and NEXT VALUE FOR | no default | `default_not_translated` |
| CHECK constraints | translated |  |
| CHECK constraints with functions SQLite lacks | not created | `check_skipped` |
| CHECK constraints added WITH NOCHECK or disabled | not created | `check_not_enforced` |
| filtered and columnstore indexes | not created | `index_skipped` |
| foreign keys | in CREATE TABLE, loaded unchecked, then listed by PRAGMA foreign_key_check |  |
| foreign keys to tables the dump doesn't create | not created | `foreign_key_skipped` |
| tables on a partition scheme | one table with every partition's rows | `partitions_dropped` |
| temporal tables (SYSTEM_VERSIONING) | two tables: the current rows and the history | `system_versioning_dropped` |
| schemas | one file, tables named after their schema first | `schemas_merged` |
| NOT NULL columns with values that become NULL | NOT NULL dropped | `not_null_relaxed` |
| views, functions, procedures, triggers, synonyms, types and partition functions | listed in the report | `not_converted_objects` |
| scripts without CREATE TABLE (data only) | types read from the values | `no_schema` |
| expressions in INSERT values | NULL | `expression_value` |
| types IntoSQL doesn't know | TEXT | `unknown_type` |
| NUL characters in text | kept |  |
| text that isn't valid in its encoding | the bad bytes as the replacement character | `invalid_utf8_replaced` |
| text decoded twice (Ã±) | copied as it is | `mojibake_suspected` |

## Load the script into SQLite

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
sqlite3 -bail mydb.sqlite < sql_server.sqlite.sql
```

Foreign keys are declared in each table and the rows load with foreign key checks off. The script then lists any row that points to a row that doesn't exist, instead of failing half way.

For a large dump, load into a new file on a local disk. The script loads everything in one transaction with syncing off, so it runs at disk speed, and a load that stops half way leaves no partial tables.

The command line loads the file straight into a SQLite database, without writing a script. It's free.

## Dump SQL Server for the best result

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

- In SSMS, right-click the database, Tasks, Generate Scripts, and pick the tables. dbatools, mssql-scripter and other tools built on the same library write the same script.
- Under Advanced, set Types of data to script to Schema and data. A script of the schema alone has tables without rows.
- Save it as Unicode, SSMS's default, or as UTF-8: both are read the same way, and gzip works too.

## What isn't converted

Views, functions, procedures, triggers, synonyms, rules and security policies are written in T-SQL. They are listed in the report by name, never dropped silently, so you can rewrite them for SQLite.

## Questions about SQL Server to SQLite

### 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.

### Does it read the UTF-16 file SSMS saves?

Yes. SSMS saves scripts as UTF-16 by default, and the converter reads UTF-16 and UTF-8 alike, gzipped or not, with GO between batches.

### Which SQL Server versions can the script come from?

Scripts that SSMS, dbatools or mssql-scripter write from SQL Server 2017 on. Every test script comes from SQL Server 2017, 2022 and 2025 and is compared with its source cell by cell.

### Are IDENTITY values kept?

An IDENTITY column that is the table's whole primary key becomes INTEGER PRIMARY KEY AUTOINCREMENT, every row keeps its id, and the next id continues after the highest one. Any other keeps its values without a counter.

### What happens to money, datetimeoffset and other SQL Server types?

bit becomes 0 and 1, datetime2 ISO 8601 text with every digit, datetimeoffset UTC text, and wide decimals and money exact text. Computed columns stay computed. Schemas become table name prefixes.

### What about procedures, triggers and views?

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

### Which SQLite versions does the script load on?

SQLite 3.31 and later. Every test script loads on 3.31 and 3.54, stopping at the first error if anything goes wrong.

## From SQL Server

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

## Into SQLite

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

## Guide and every pair

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