Migrate SQLite to SQL Server
Certified — live-tested pathThe converter maps 8 SQLite column types to SQL Server. One of them changes kind on the way (NUMERIC becomes FLOAT(53)); the table below lists every one. DBShifts converts the schema, copies the rows in parallel batches and checks the result with row counts and checksums.
Free tier · no credit card
SQLite vs SQL Server
SQLite
the embedded database that ships inside everything.
SQL Server
Microsoft's enterprise relational database.
SQLite to SQL Server data type mapping
Pulled directly from DBShifts's own conversion rules — not a general reference table, this is what actually runs.
| SQLite | SQL Server |
|---|---|
| INTEGER | BIGINT |
| REAL | FLOAT(53) |
| TEXT | NVARCHAR(MAX) |
| BLOB | VARBINARY(MAX) |
| NUMERIC | FLOAT(53) |
| BOOLEAN | BIT |
| DATETIME | DATETIME2 |
| VARCHAR(255) | NVARCHAR(255) |
Example: SQLite to SQL Server schema conversion
SQLite
CREATE TABLE orders ( id INTEGER PRIMARY KEY AUTOINCREMENT, customer_id INTEGER NOT NULL, total NUMERIC NOT NULL, is_gift BOOLEAN NOT NULL DEFAULT 0, notes TEXT, placed_at DATETIME NOT NULL );
SQL Server
IF OBJECT_ID(N'orders', 'U') IS NULL
CREATE TABLE [orders] (
[id] BIGINT IDENTITY(1,1) NOT NULL,
[customer_id] BIGINT NOT NULL,
[total] FLOAT(53) NOT NULL,
[is_gift] BIT NOT NULL DEFAULT 0,
[notes] NVARCHAR(MAX),
[placed_at] DATETIME2 NOT NULL,
CONSTRAINT [PK_orders] PRIMARY KEY ([id])
);Everything SQLite did not enforce, SQL Server will
SQLite's type affinity means a column declared INTEGER may genuinely contain text, and a VARCHAR(10) may contain much longer values. SQL Server enforces both. The result is that a migration which looks trivial by schema size can fail row by row on data that was never valid against its own declared types.
Expect this to surface as failed inserts rather than as conversion errors, because the schema converts cleanly. Profiling the actual values per column before the load, rather than trusting the declared types, is what makes this migration predictable.
The same applies to NULL in primary keys. SQLite permits NULL in a PRIMARY KEY column that is not INTEGER PRIMARY KEY, which SQL Server does not allow at all.
Dates stored as text
SQLite has no date type, so dates arrive as text, as integers holding Unix time, or as floats holding Julian day numbers, depending on what the application chose. All three are common and they cannot be distinguished from the schema.
The conversion to DATETIME2 has to know which convention was used, and getting it wrong produces either a parse failure or, worse, plausible dates that are decades out. Sampling the actual values is the only reliable way to tell.
Going from a file to a server
This migration usually accompanies a change in how the application is deployed: from an embedded database shipped with the product to a shared server that several instances or users hit at once. That change brings requirements the SQLite schema never had to express, notably concurrent access, authentication and backup.
It is worth adding what the file-based schema left out at the same time: appropriate indexes for the new access patterns, explicit NOT NULL where the application always sets a value, and the foreign keys that SQLite may never have enforced.
SQLite → SQL Server conversion notes
Engine-specific rules baked into the conversion and transfer pipeline — verified by live certification of this exact pair.
- INTEGER columns are 64-bit — DBShifts maps them to BIGINT so large IDs don't overflow 32-bit INT targets.
- Typeless and mixed-affinity columns (SQLite's dynamic typing) are inferred, stringified safely, and flagged.
- NUMERIC affinity values are read exactly, not through float round-trips.
- IDENTITY_INSERT is managed per table so explicit IDs from the source load correctly, then counters are reseeded with DBCC CHECKIDENT.
- Binary columns always carry an explicit length — bare VARBINARY (which means 1 byte) never reaches the target.
- TRUNCATE falls back to DELETE on FK-referenced tables automatically.
Frequently asked questions
Is SQLite to SQL Server migration production-ready in DBShifts?
Yes. SQLite to SQL Server is a certified pair: it passes the live certification suite on real SQLite and SQL Server servers, which checks schema fidelity, row counts, type-aware checksums and paging across batches.
What happens to SQLite types that SQL Server doesn't have?
Each gets the nearest SQL Server type the converter treats as safe: NUMERIC becomes FLOAT(53). Every such decision is in the migration plan before anything runs, and any mapping can be overridden per column.
Can I keep SQLite and SQL Server in sync after the initial migration?
Not continuously: SQLite keeps no change log to read. Incremental sync re-runs copy only the rows that changed, using a per-table sync key.
Go deeper
How We Live-Certified All 49 Migration Paths
The certification harness behind this page's claims.
Why Row Counts Aren't Enough
How type-aware checksum validation works.
Reference
Compared with other tools
Errors you may hit
Ready to move SQLite to SQL Server?
Set up in under two minutes. Validation and rollback included.
Start Free Migration