SQLite to T-SQL Script Builder — Migration Script Generator
Drop a SQLite database file and get a complete, ordered set of T-SQL migration scripts for SQL Server. Schema creation, data inserts, foreign keys, and a validation report — all generated locally in your browser.
SQLite → SQL Server
Drop a .sqlite file to generate a complete T-SQL migration script
or Browse Files · .sqlite, .db, .sqlite3
⚙ Migration Settings
📋 Schema Overview
🔀 Type Mapping Overrides
What Does This Tool Do?
The SQLite to T-SQL Script Builder reads a SQLite database file entirely in your browser using sql.js (a WebAssembly build of SQLite). It inspects the schema — tables, columns, data types, primary keys, foreign keys, indexes — and generates a set of numbered T-SQL scripts that recreate the entire database in SQL Server.
The scripts are ordered for dependency safety: database creation first, then tables in topological order (parents before children), data inserts with configurable batch sizes, foreign key constraints, and finally a validation report that checks row counts match the source.
Generated Script Breakdown
| Script | Contents | Purpose |
|---|---|---|
| 01_Create_Database.sql | CREATE DATABASE, USE, optional DROP | Set up the target database |
| 02_Schema.sql | CREATE TABLE with mapped types, PKs, indexes | Recreate all table structures |
| 03_Data_*.sql | Batched INSERT statements per table | Migrate all row data |
| 04_Foreign_Keys.sql | ALTER TABLE ADD CONSTRAINT for FKs | Restore referential integrity |
| 05_Validation.sql | Row count checks per table | Verify migration completeness |
Type Mapping Reference
| SQLite Type | Default SQL Server Type | Notes |
|---|---|---|
| INTEGER | BIGINT | Covers SQLite's flexible integer storage |
| TEXT | NVARCHAR(MAX) | Unicode-safe; override length as needed |
| REAL / FLOAT | FLOAT | Double-precision floating point |
| BLOB | VARBINARY(MAX) | Binary data preserved as hex literals |
| BOOLEAN | BIT | 0/1 mapping |
| DATETIME | DATETIME2 | Higher precision than legacy DATETIME |
| NUMERIC / DECIMAL | DECIMAL(18,6) | Override precision in the type mapping panel |
