Skip to content
Guide · SSMS

How to Import CSV in SSMS

SSMS gives you three documented ways to load a CSV file into SQL Server: the Import Flat File Wizard for a quick load into a new table, the SQL Server Import and Export Wizard when you need more control or an existing table, and the T-SQL BULK INSERT statement for repeatable loads. This guide walks through each as Microsoft documents it, with the options that most often cause failed imports: data types, encoding and header rows.

Steps and facts checked 8 October 2026 against the vendor's official documentation. Versions covered: SSMS 22.10.2; SQL Server 2017 and later for BULK INSERT FORMAT = 'CSV'. Next review due April 2027. Menus, shortcuts and prices change between releases; check the vendor's documentation for your version.
Short answer
  • Quickest route: right-click the database, choose Tasks > Import Flat File, pick the .csv file and a new table name, check the detected columns, and finish.
  • The Import Flat File Wizard always creates a new table, detects data types from the first 200 rows, and reads the file using the system's active code page (usually ANSI).
  • To load into an existing table or choose encoding, delimiters and text qualifiers yourself, use Tasks > Import Data (the Import and Export Wizard), which in SSMS 22 comes with the Integration Services component.
  • For scripted loads, BULK INSERT with FORMAT = 'CSV' (SQL Server 2017 and later) reads a file path as seen from the SQL Server machine, not from your PC.
How we know: Research-based: the wizard steps, options, limits and the BULK INSERT syntax were checked against Microsoft Learn (Import Flat File to SQL Wizard, Start the SQL Server Import and Export Wizard, Connect to a Flat File Data Source, Import data from Excel to SQL, BULK INSERT (Transact-SQL), SSMS components and workload IDs, SSMS 22 release notes) on 8 October 2026. We have not run these imports for this guide and it has no screenshots; the sample file and statement below follow the documented syntax.

SSMS import CSV: which method to use

If your data is in an Excel workbook, Microsoft's advice for the flat-file wizard and BULK INSERT is to save the sheet as CSV first (File > Save As > CSV (Comma delimited)), keeping only the header row and data rows. Each sheet is saved separately.

A small sample file, customers.csv, to try any method with
CustomerID,FullName,City,SignupDate
1,"Patel, Asha",Leeds,2026-01-15
2,Tom Baker,Bristol,2026-02-03
3,Mia Wong,York,2026-03-21
Ways to import a CSV file with SSMS 22
MethodBest forTarget tableMain limits
Import Flat File WizardOne-off loads of a clean fileAlways a new tableTypes detected from the first 200 rows; uses the system code page
Import and Export WizardExisting tables, encoding and delimiter control, saving as an SSIS packageNew or existingNeeds the Integration Services component; more pages to step through
BULK INSERT (T-SQL)Repeatable, scripted loadsExisting tableFile path must be readable by the SQL Server service; needs bulk permissions

Method 1: the Import Flat File Wizard

Microsoft describes this wizard as a simple way to copy data from a flat file such as .csv or .txt into a new table. It uses the PROSE framework to infer column names, types and delimiters, and supports commas, tabs, semicolons, pipes and fixed-width files.

  1. In Object Explorer, connect to the server, expand Databases, right-click the target database, point to Tasks and select Import Flat File (just above Import Data).
  2. On Specify Input File, choose Browse, select the file and enter a new table name. The name must be unique; the wizard will not continue otherwise.
  3. On Preview Data, check the first 50 rows. If anything looks wrong, cancel and fix the file.
  4. On Modify Columns, correct names, data types, primary key and Allow Nulls. Widen text columns (for example nvarchar(100) instead of the detected length) if later rows may be longer.
  5. Review the Summary and select Finish. The Results page shows whether the import succeeded.

Common failures. Types are detected from the first 200 rows, so a longer value or a stray text value further down causes errors such as "String or binary data would be truncated". Microsoft suggests widening the column types on Modify Columns, and enabling error reporting with a small range to find the offending rows. The wizard reads the file with the system's active code page (usually ANSI), so accented characters in a UTF-8 file can come through wrongly; use one of the other methods if that matters.

Method 2: the SQL Server Import and Export Wizard

Use this wizard to append to an existing table, set the code page, or save the job as an SSIS package. In SSMS 22 the wizard belongs to the Integration Services component, part of the Business Intelligence workload in the Visual Studio Installer; SSMS 22.0.0 reinstated it. If Import Data is missing from the Tasks menu, modify the SSMS installation to add that component.

  1. Right-click the database, point to Tasks and select Import Data.
  2. On Choose a Data Source, select Flat File Source and browse to the file.
  3. On the General page, set Unicode or a Code page, keep Format as Delimited, set Text qualifier to " if fields are quoted, and tick Column names in the first data row.
  4. On the Columns page, check the row delimiter (usually {CR}{LF}) and column delimiter (Comma); then review types on Advanced and the Preview.
  5. Choose the destination (your SQL Server and database), map to a new or existing table, then run the package or save it.

Press F1 on any wizard page to open Microsoft's help for that page.

Method 3: BULK INSERT from a query window

BULK INSERT loads a file into an existing table and can be saved as a script. Since SQL Server 2017, FORMAT = 'CSV' follows RFC 4180, with FIELDQUOTE defaulting to a double quote, so quoted fields containing commas load correctly. CODEPAGE = '65001' reads UTF-8.

Three things trip people up. The path is resolved on the server running SQL Server (use a UNC path for a file share), and with SQL Server Authentication the file is read as the SQL Server service account. You need INSERT and ADMINISTER BULK OPERATIONS permissions (ADMINISTER DATABASE BULK OPERATIONS in Azure SQL Database, where the file must be in Azure Storage). And Microsoft notes that FIRSTROW is not intended to skip headers: it is used that way in Microsoft's own CSV example, but the skipped rows are not validated, so make sure the header has the same number of fields as the data rows.

T-SQL (SQL Server 2017 and later): load customers.csv into a new table
CREATE TABLE dbo.Customers (
    CustomerID int NOT NULL PRIMARY KEY,
    FullName   nvarchar(100) NOT NULL,
    City       nvarchar(50) NULL,
    SignupDate date NULL
);

BULK INSERT dbo.Customers
FROM 'C:\data\customers.csv'
WITH (
    FORMAT = 'CSV',
    FIRSTROW = 2,
    FIELDTERMINATOR = ',',
    ROWTERMINATOR = '0x0a',
    CODEPAGE = '65001'
);

Check the result

Run SELECT COUNT(*) FROM dbo.Customers; and compare it with the number of data rows in the file, then spot-check text with accents and dates. If an insert fails with a duplicate key, see error 2627; truncation errors are covered under error 8152. To go the other way, see How to export query results to Excel/CSV in SSMS in the related guides. On macOS or Linux, the MSSQL extension for VS Code has its own Import flat file wizard; see the VS Code MSSQL extension review.

Frequently asked questions

Where is Import Flat File in SSMS?

In Object Explorer, right-click a database, point to Tasks, and select Import Flat File. It sits just above Import Data.

Can the Import Flat File Wizard append to an existing table?

No. Microsoft describes it as copying data into a new table, and the table name must be unique. Use the Import and Export Wizard or BULK INSERT to load into an existing table.

Why are special characters wrong after importing a CSV?

The Import Flat File Wizard uses the system's active code page, usually ANSI. For UTF-8 files, set the code page in the Import and Export Wizard or use BULK INSERT with CODEPAGE = '65001'.

Why is Import Data missing from the Tasks menu in SSMS 22?

The Import and Export Wizard comes with the Integration Services management component (Business Intelligence workload). Open the Visual Studio Installer, choose Modify on SSMS 22, and add it.

Can SSMS import an Excel file directly?

The Import and Export Wizard can read Excel directly for SQL Server on-premises, if the Excel provider is installed. The Import Flat File Wizard and BULK INSERT need the sheet saved as CSV first.

Why does BULK INSERT say the file cannot be opened?

The path is read by the SQL Server service on the server, not by SSMS on your PC. Put the file on the server or a share the service account can read, and use a UNC path for shares.

Sources

Checked 8 October 2026.

How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.

Still choosing a SQL client?

Read the full reviews, or compare tools side by side.