---
title: "Convert Excel to SQL Server"
description: "Convert Excel files to SQL for SQL Server in your browser: a CREATE TABLE with typed columns, then INSERT statements. Free, and your file is never uploaded."
canonical: https://intosql.com/excel-to-sql-server
last_updated: 2026-10-15
---

# Convert Excel to SQL Server

Drop your Excel file to get a SQL Server script with CREATE TABLE and INSERT statements. Each column gets a type, and every fix is listed with its row and column.

## From Excel to SQL Server, column by column

The sample above, clientes_2024.xlsx, as IntoSQL writes it for SQL Server: what each column holds in the file, the type it gets and how its first value lands in the script.

| In the file | First value | Column | SQL Server type | In the script |
| --- | --- | --- | --- | --- |
| Nº Cliente | `00127` | `no_cliente` | `nvarchar(8)` | `N'00127'` |
| Nombre | `Peña Muñoz` | `nombre` | `nvarchar(16)` | `N'Peña Muñoz'` |
| C.P. | `01234` | `c_p` | `nvarchar(8)` | `N'01234'` |
| Alta | `03/02/2024` | `alta` | `date` | `'2024-02-03'` |
| Activo | `sí` | `activo` | `bit` | `1` |
| Saldo | `1.234,50` | `saldo` | `decimal(6,2)` | `1234.50` |

## Load the script into SQL Server

The download is a plain .sql file. Run it with SQL Server's own tools.

### SQL Server

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

-f 65001 reads the file as UTF-8, so accents and ñ arrive as written. In SQL Server Management Studio or Azure Data Studio, open the file and choose Execute.

## What IntoSQL reads in Excel files

- The header row is found even when titles or notes sit above it, and a totals row at the end is left out.
- Dates stored as Excel serial numbers become real dates, in both the 1900 and the 1904 date systems.
- Codes with leading zeros, like 00127, stay text. When a workbook has several sheets, you pick the sheet.

## What to know about SQL Server

- Text is nvarchar with N'...' values, so accents survive; text over 4000 characters becomes nvarchar(max).
- Yes and no values become bit, and dates with an offset become datetimeoffset.
- Long values are written in pieces, so sqlcmd and SQL Server Management Studio accept the script.

### How each kind of value is stored in SQL Server

| Value | SQL Server |
| --- | --- |
| Yes and no | `bit` |
| Whole numbers | `int` |
| Large whole numbers | `bigint` |
| Decimals | `decimal(p,s)` |
| Floating-point numbers | `float` |
| Dates | `date` |
| Times of day | `time` |
| Dates with a time | `datetime2` |
| Dates with a time and offset | `datetimeoffset` |
| Text | `nvarchar(n) · nvarchar(max)` |

## Questions about Excel to SQL Server

### How do I convert Excel to SQL Server?

Drop your file on the converter at the top of this page. It finds the header, reads every value and writes the SQL Server script, listing each fix it made. Download the script and run it with sqlcmd.

### Which sheet of the workbook is converted?

The first visible sheet. When a workbook has more than one, a Sheet option appears, so you can pick another.

### Which SQL Server types does it use?

Yes and no values become bit, whole numbers int, decimals decimal(p,s), dates date, dates with a time datetime2 and text nvarchar(n). Sizes come from the longest value in each column.

### Does it keep leading zeros in SQL Server?

Yes. A code such as 00127 stays text, so SQL Server stores it as nvarchar(8) and the script writes it as N'00127'.

### Can it load the data into SQL Server without a script?

No. Download the script and run it with sqlcmd. Loading without a script works for PostgreSQL, MySQL, MariaDB and SQLite, from the desktop app or the command line.

### How big can the Excel file be?

In the browser, a workbook is read whole, so the limit is the memory the browser gives this page. The desktop app and the command line take workbooks of any size; on an Apple M4 laptop the command line converts a 117 MB workbook of a million rows in about a second.

## Excel into other databases

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

## Other files into SQL Server

- [Convert CSV to SQL Server](https://intosql.com/csv-to-sql-server)
- [Convert JSON to SQL Server](https://intosql.com/json-to-sql-server)
