How to Migrate Access to SQL Server: Step-by-Step Tutorial
🚀 Open the Access to T-SQL Script Builder and follow along.
Open Tool →Steps
This tutorial walks you through migrating a Microsoft Access database to SQL Server using the Access to T-SQL Script Builder. The tool reads your .mdb or .accdb file entirely in your browser — nothing is uploaded — and generates a complete set of T-SQL scripts you can run against any SQL Server instance.
Step 1: Locate Your Access File
Find the .mdb or .accdb file you want to migrate. The tool supports all Access versions from Access 97 (Jet 3) through Microsoft 365 (ACE 16). Make sure the file is not currently open in Access or locked by another process — while the browser reads a copy, a locked file may not copy correctly to the browser's file input.
Tip: If you have an Access front-end/back-end split, you want the back-end file — that's the one containing the data tables.
Step 2: Drop the File into the Tool
Open the Access to T-SQL Script Builder. You'll see a drop zone at the top of the tool. Either drag your file onto it or click to browse. The tool uses mdb-reader, a pure JavaScript Access parser, to read the file entirely in your browser. The status bar will show "Loading…" and then switch to "Ready" with the number of tables detected.
Step 3: Review the Schema Overview
Once the file is loaded, the tool displays a Database Info bar showing the format (Jet 3, Jet 4, ACE 12, etc.), table count, total rows, and relationship count. Below that, a Schema Overview section shows cards for each table with column names, types, primary key indicators, and row counts.
Review the schema cards to make sure all expected tables are present. System tables (names starting with MSys) are automatically filtered out.
Step 4: Adjust Type Mappings
The Type Mapping panel shows every Access data type detected in your database with the default SQL Server equivalent. Review these mappings and adjust any that don't fit your needs. Common overrides include:
- Changing
NVARCHAR(MAX)to a specific length for Memo fields you know are short - Switching
FLOATtoDECIMAL(18,2)for Double fields that store financial data - Using
DATEinstead ofDATETIME2for Date/Time fields that don't include time components
Step 5: Configure Settings
Expand the Configuration panel to set options for the generated scripts:
- Database name — the
CREATE DATABASEstatement will use this name - Schema — typically
dbo - Batch size — number of rows per
INSERTstatement (default 1,000) - Include DROP IF EXISTS — useful for re-running during testing
- Include database creation — uncheck for Azure SQL Database
Step 6: Generate Scripts
Click the Generate T-SQL Script button. The tool produces a set of numbered script files:
| File | Contents |
|---|---|
| 01_Create_Database.sql | CREATE DATABASE + schema |
| 02_Create_Tables.sql | All table definitions with mapped types |
| 03_xx_Load_*.sql | One per table with batched INSERT statements |
| 04_Foreign_Keys.sql | All relationship constraints |
| 05_Validation.sql | Row count verification |
Step 7: Download and Review
Click Download .zip to get all scripts in a single archive. Before running anything, open the scripts in a text editor and review them — especially the table definitions and any tables with complex data types.
Step 8: Run in SQL Server
Connect to your SQL Server instance using SSMS, Azure Data Studio, or sqlcmd. Run the scripts in order:
01_Create_Database.sql— creates the target database02_Create_Tables.sql— creates all tables03_xx_Load_*.sqlfiles — in the numbered order (tables are topologically sorted so parents load before children)04_Foreign_Keys.sql— adds relationship constraints05_Validation.sql— verifies row counts
Tip: If any foreign key constraint fails, it usually means a parent table is missing a referenced row. Check the validation script output first, then investigate the specific constraint.
Step 9: Validate
Run the validation script to compare row counts between source and target. The script reports PASS or FAIL for each table and gives a summary at the end. Beyond row counts, spot-check a few rows — especially date fields, currency values, and Yes/No columns — to confirm data fidelity.
🚀 Try it now — drop your .mdb or .accdb file and get T-SQL scripts in seconds.
Open Tool →Related Tools & Guides
Further reading: Microsoft — T-SQL Reference
