You are on page 1of 128

Table of Contents

SQL Server Import and Export Wizard


Get started with this simple example of the Import and Export Wizard
Start the SQL Server Import and Export Wizard
Connect to Data Sources with the SQL Server Import and Export Wizard
Connect to a SQL Server Data Source (SQL Server Import and Export Wizard)
Connect to an Oracle Data Source (SQL Server Import and Export Wizard)
Connect to a Flat File Data Source (SQL Server Import and Export Wizard)
Connect to an Excel Data Source (SQL Server Import and Export Wizard)
Connect to an Access Data Source (SQL Server Import and Export Wizard)
Connect to Azure Blob Storage (SQL Server Import and Export Wizard)
Connect to an ODBC Data Source (SQL Server Import and Export Wizard)
Connect to a PostgreSQL Data Source (SQL Server Import and Export Wizard)
Connect to a MySQL Data Source (SQL Server Import and Export Wizard)
Steps in the SQL Server Import and Export Wizard
Welcome to SQL Server Import and Export Wizard
Choose a Data Source (SQL Server Import and Export Wizard)
Choose a Destination (SQL Server Import and Export Wizard)
Create Database (SQL Server Import and Export Wizard)
Specify Table Copy or Query (SQL Server Import and Export Wizard)
Provide a Source Query (SQL Server Import and Export Wizard)
Select Source Tables and Views (SQL Server Import and Export Wizard)
Configure Flat File Destination (SQL Server Import and Export Wizard)
Convert Types without Conversion Checking (SQL Server Import and Export Wizard)
Column Mappings (SQL Server Import and Export Wizard)
Review Data Type Mapping (SQL Server Import and Export Wizard)
Column Conversion Details Dialog Box (SQL Server Import and Export Wizard)
Create Table SQL Statement (SQL Server Import and Export Wizard)
Preview Data Dialog Box (SQL Server Import and Export Wizard)
Save and Run Package (SQL Server Import and Export Wizard)
Save SSIS Package (SQL Server Import and Export Wizard)
Complete the Wizard (SQL Server Import and Export Wizard)
Performing Operation (SQL Server Import and Export Wizard)
Data Type Mapping in the SQL Server Import and Export Wizard
Import and Export Data with the SQL Server Import
and Export Wizard
11/30/2017 • 5 min to read • Edit Online

For content related to previous versions of SQL Server, see Run the SQL Server Import and Export Wizard.

SQL Server Import and Export Wizard is a simple way to copy data from a source to a destination. This overview
describes the data sources that the wizard can use as sources and destinations, as well as the permissions you
need to run the wizard.

Get the wizard


If you want to run the wizard, but you don't have Microsoft SQL Server installed on your computer, you can install
the SQL Server Import and Export Wizard by installing SQL Server Data Tools (SSDT). For more info, see Download
SQL Server Data Tools (SSDT).

What happens when I run the wizard?


See the list of steps. For a description of the steps in the wizard, see Steps in the SQL Server Import and
Export Wizard. There's also a separate page of documentation for each page of the wizard.
- or -
See an example. For a quick look at the several screens you see in a typical session, take a look at this simple
example on a single page - Get started with this simple example of the Import and Export Wizard.

What sources and destinations can I use?


The SQL Server Import and Export Wizard can copy data to and from the data sources listed in the following table.
To connect to some of these data sources, you may have to download and install additional files.

DATA SOURCE DO I HAVE TO DOWNLOAD ADDITIONAL FILES?


DATA SOURCE DO I HAVE TO DOWNLOAD ADDITIONAL FILES?

Enterprise databases SQL Server or SQL Server Data Tools (SSDT) installs the files
SQL Server, Oracle, DB2, and others. that you need to connect to SQL Server. But SSDT doesn't
install all the files that you need to connect to other enterprise
databases such as Oracle or IBM DB2.

To connect to an enterprise database, you typically have to


have two things:

1. Client software. If you already have the client software


installed for your enterprise database system, then you
typically have what you need to make a connection. If you
don't have the client software installed, ask the database
administrator how to install a licensed copy.

2. Drivers or providers. Microsoft installs drivers and


providers to connect to Oracle. To connect to IBM DB2, get
the Microsoft® OLEDB Provider for DB2 v5.0 for Microsoft
SQL Server from the Microsoft SQL Server 2016 Feature Pack.

For more info, see Connect to a SQL Server Data Source or


Connect to an Oracle Data Source.

Text files (flat files) No additional files required.

For more info, see Connect to a Flat File Data Source.

Microsoft Excel and Microsoft Access files Microsoft Office doesn't install all the files that you need to
connect to Excel and Access files as data sources. Get the
following download - Microsoft Access Database Engine 2016
Redistributable.

For more info, see Connect to an Excel Data Source or


Connect to an Access Data Source.

Azure data sources SQL Server Data Tools don't install the files that you need to
Currently only Azure Blob Storage. connect to Azure Blob Storage as a data source. Get the
following download - Microsoft SQL Server 2016 Integration
Services Feature Pack for Azure.

For more info, see Connect to Azure Blog Storage.

Open source databases To connect to these data sources, you have to download
PostgreSQL, MySql, and others. additional files.

- For PostgreSQL, see Connect to a PostgreSQL Data Source.


- For MySql, see Connect to a MySQL Data Source.

Any other data source for which a driver or provider is You typically have to download additional files to connect to
available the following types of data sources.

- Any source for which an ODBC driver is available. For more


info, see Connect to an ODBC Data Source.
- Any source for which a .Net Framework Data Provider is
available.
- Any source for which an OLE DB Provider is available.

Third-party components that provide source and destination


capabilities for other data sources are sometimes marketed as
add-on products for SQL Server Integration Services (SSIS).
How do I connect to my data?
For info about how to connect to a commonly used data source, see one of the following pages:
Connect to SQL Server
Connect to Oracle
Connect to flat files (text files)
Connect to Excel
Connect to Access
Connect to Azure Blob Storage
Connect with ODBC
Connect to PostgreSQL
Connect to MySQL
For info about how to connect to a data source that's not listed here, see The Connection Strings Reference. This
third-party site contains sample connection strings and more info about data providers and the connection info
they require.

What permissions do I need?


To run the SQL Server Import and Export Wizard successfully, you have to have at least the following permissions.
If you already work with your data source and destination, you probably already have the permissions that you
need.

IF YOU'RE CONNECTING TO SQL SERVER, YOU NEED THESE SPECIFIC


YOU NEED PERMISSIONS TO DO THESE THINGS PERMISSIONS

Connect to the source and destination databases or file Server and database login rights.
shares.

Export or read data from the source database or file. SELECT permissions on the source tables and views.

Import or write data to the destination database or file. INSERT permissions on the destination tables.

Create the destination database or file, if applicable. CREATE DATABASE or CREATE TABLE permissions.

Save the SSIS package created by the wizard, if applicable. If you want to save the package to SQL Server, permissions
sufficient to save the package to the msdb database.

Get help while the wizard is running


TIP
Tap the F1 key from any page or dialog box of the wizard to see documentation for the current page.

The wizard uses SQL Server Integration Services (SSIS)


The wizard uses SQL Server Integration Services (SSIS) to copy data. SSIS is a tool for extracting, transforming, and
loading data (ETL). The pages of the wizard use some of the language of SSIS.
In SSIS, the basic unit is the package. The wizard creates an SSIS package in memory as you move through the
pages of the wizard and specify options.
At the end of the wizard, if you have SQL Server Standard Edition or higher installed, you can optionally save the
SSIS package. Later you can reuse the package and extend it by using SSIS Designer to add tasks, transformations,
and event-driven logic. The SQL Server Import and Export Wizard is the simplest way to create a basic Integration
Services package that copies data from a source to a destination.
For more info about SSIS, see SQL Server Integration Services.

What's next?
Start the wizard. For more info, see Start the SQL Server Import and Export Wizard.

See also
Get started with this simple example of the Import and Export Wizard
Data Type Mapping in the SQL Server Import and Export Wizard
Get started with this simple example of the Import
and Export Wizard
12/18/2017 • 7 min to read • Edit Online

Learn what to expect in the SQL Server Import and Export Wizard by walking through a common scenario -
importing data from an Excel spreadsheet to a SQL Server database. Even if you plan to use a different source
and a different destination, this topic shows you most of what you need to know about running the wizard.

Prerequisite - Is the wizard installed on your computer?


If you want to run the wizard, but you don't have Microsoft SQL Server installed on your computer, you can
install the SQL Server Import and Export Wizard by installing SQL Server Data Tools (SSDT). For more info, see
Download SQL Server Data Tools (SSDT).

Here's the Excel source data for this example


Here's the source data that you're going to copy - a small two-column table in the WizardWalkthrough
worksheet of the WizardWalkthrough.xlsx Excel workbook.

Here's the SQL Server destination database for this example


Here (in SQL Server Management Studio) is the SQL Server destination database to which you're going to copy
the source data. The destination table isn't there - you're going to let the wizard create the table for you.
Step 1 - Start the wizard
You start the wizard from the Microsoft SQL Server 2016 group on the Windows Start menu.

NOTE
For this example, you pick the 32-bit wizard because you have the 32-bit version of Microsoft Office installed. As a result,
you have to use the 32-bit data provider to connect to Excel. For many other data sources, you can typically pick the 64-
bit wizard.
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data
Tools (SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the
32-bit version of the wizard.

For more info, see Start the SQL Server Import and Export Wizard.

Step 2 - View the Welcome page


The first page of the wizard is the Welcome page.
You probably don't want to see this page again, so go ahead and click Do not show this starting page again.
Step 3 - Pick Excel as your data source
On the next page, Choose a Data Source, you pick Microsoft Excel as your data source. Then you browse to pick
the Excel file. Finally you specify the Excel version that you used to create the file.

For more info about connecting to Excel, see Connect to an Excel Data Source. For more info about this page of
the wizard, see Choose a Data Source.

Step 4 - Pick SQL Server as your destination


On the next page, Choose a Destination, you pick Microsoft SQL Server as your destination by picking one of
the data providers in the list that connects to SQL Server. In this example, you pick the .Net Framework Data
Provider for SQL Server.
The page displays a list of provider properties. Many of these are unfriendly names and unfamiliar settings.
Fortunately, to connect to any enterprise database, you typically have to provide only three pieces of information.
You can ignore the default values for the other settings.

REQUIRED INFO .NET FRAMEWORK DATA PROVIDER FOR SQL SERVER PROPERTY

Server name Data Source

Authentication (login) info Integrated Security; or User ID and Password


If you want to see a dropdown list of databases on the
server, you first have to provide valid login info.

Database name Initial Catalog

For more info about connecting to SQL Server, see Connect to a SQL Server Data Source. For more info about
this page of the wizard, see Choose a Destination.

Step 5 - Copy a table instead of writing a query


On the next page, Specify Table Copy or Query, you specify that you want to copy the entire table of source
data. You don't want to write a query in the SQL language to select the data to copy.
For more info about this page of the wizard, see Specify Table Copy or Query.

Step 6 - Pick the table to copy


On the next page, Select Source Tables and Views, you pick the table or tables that you want to copy from the
data source. Then you map each selected source table to a new or existing destination table.
In this example, by default the wizard has mapped the WizardWalkthrough$ worksheet in the Source column
to a new table with the same name at the SQL Server destination. (The Excel workbook only contains a single
worksheet.)
The dollar sign ($) on the name of the source table indicates an Excel worksheet. (A named range in Excel is
represented by its name alone.)
The starburst on the destination table icon indicates that the wizard is going to create a new destination table.

You probably want to remove the dollar sign ($) from the name of the new destination table.
For more info about this page of the wizard, see Select Source Tables and Views.

Optional step 7 - Review the column mappings


Before you leave the Select Source Tables and Views page, optionally click the Edit Mappings button to open
the Column Mappings dialog box. Here, in the Mappings table, you see how the wizard is going to map
columns in the source worksheet to columns in the new destination table.

For more info about this page of the wizard, see Column Mappings.

Optional step 8 - Review the CREATE TABLE statement


While the Column Mappings dialog box is open, optionally click the Edit SQL button to open the Create Table
SQL Statement dialog box. Here you see the CREATE TABLE statement generated by the wizard to create the
new destination table. Typically you don't have to change the statement.
For more info about this page of the wizard, see Create Table SQL Statement.

Optional step 9 - Preview the data to copy


After you click OK to close the Create Table SQL Statement dialog box, then click OK again to close the
Column Mappings dialog box, you're back on the Select Source Tables and Views page. Optionally click the
Preview button to see a sample of the data that the the wizard is going to copy. In this example, it looks OK.

For more info about this page of the wizard, see Preview Data.

Step 10 - Yes, you want to run the import-export operation


On the next page, Save and Run Package, you leave Run immediately enabled to copy the data as soon as
you click Finish on the next page. Or you can skip the next page by clicking Finish on the Save and Run
Package page.
For more info about this page of the wizard, see Save and Run Package.

Step 11 - Finish the wizard and run the import-export operation


If you clicked Next instead of Finish on the Save and Run Package page, then on the next page, Complete the
Wizard, you see a summary of what the wizard is going to do. Click Finish to run the import-export operation.

For more info about this page of the wizard, see Complete the Wizard.

Step 12 - Review what the wizard did


On the final page, watch as the wizard finishes each task, then review the results. The highlighted line indicates
that the wizard copied your data successfully. You're finished!

For more info about this page of the wizard, see Performing Operation.

Here's the new table of data copied to SQL Server


Here (in SQL Server Management Studio) you see the new destination table that the wizard created in SQL
Server.
Here (again in SSMS) you see the data that the wizard copied to SQL Server.

Learn more
Learn more about how the wizard works.
Learn more about the wizard. If you're looking for an overview of the wizard, see Import and Export
Data with the SQL Server Import and Export Wizard.
Learn about the steps in the wizard. If you're looking for info about the steps in the wizard, select the
page you want from the list here - Steps in the SQL Server Import and Export Wizard. There's also a
separate page of documentation for each page of the wizard.
Learn how to connect to data sources and destinations. If you're looking for info about how to
connect to your data, select the page you want from the list here - Connect to data sources with the SQL
Server Import and Export Wizard. There's a separate page of documentation for each of several commonly
used data sources.
Start the SQL Server Import and Export Wizard
11/30/2017 • 4 min to read • Edit Online

For content related to previous versions of SQL Server, see Run the SQL Server Import and Export Wizard.

Start the SQL Server Import and Export Wizard in one of the ways described in this topic to import data from and
export data to any supported data source.

IMPORTANT
This topic describes only how to start the wizard. If you're looking for something else, see Related tasks and content.

You can start the wizard:


From the Start menu.
From the command prompt.
From SQL Server Management Studio (SSMS).
From Visual Studio with SQL Server Data Tools (SSDT).

Prerequisite - Is the wizard installed on your computer?


If you want to run the wizard, but you don't have Microsoft SQL Server installed on your computer, you can install
the SQL Server Import and Export Wizard by installing SQL Server Data Tools (SSDT). For more info, see Download
SQL Server Data Tools (SSDT).

NOTE
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data Tools
(SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the 32-bit
version of the wizard.

Start menu
Start the SQL Server Import and Export Wizard from the Start menu
1. On the Start menu, find and expand Microsoft SQL Server 2016.
2. Click one of the following options.
SQL Server 2016 Import and Export Data (64-bit)
SQL Server 2016 Import and Export Data (32-bit)
Run the 64-bit version of the wizard unless you know that your data source requires a 32-bit data provider.
Command prompt
Start the SQL Server Import and Export Wizard from the command prompt
In a Command Prompt window, run DTSWizard.exe from one of the following locations.
C:\Program Files\Microsoft SQL Server\130\DTS\Binn for the 64-bit version.
C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn for the 32-bit version.
Run the 64-bit version of the wizard unless you know that your data source requires a 32-bit data provider.

SQL Server Management Studio (SSMS)


Start the SQL Server Import and Export Wizard from SQL Server Management Studio (SSMS )
1. In SQL Server Management Studio, connect to an instance of the SQL Server Database Engine.
2. Expand Databases.
3. Right-click a database.
4. Point to Tasks.
5. Click one of the following options.
Import Data
Export Data
If you don't have SQL Server installed, or you have SQL Server but don't have SQL Server Management Studio
installed, see Download SQL Server Management Studio (SSMS).

Visual Studio
Start the SQL Server Import and Export Wizard from Visual Studio with SQL Server Data Tools (SSDT )
In Visual Studio with SQL Server Data Tools (SSDT), with an Integration Services project open, do one of the
following things.
On the Project menu, click SSIS Import and Export Wizard.

- or -
In Solution Explorer, right-click the SSIS Packages folder, and then click SSIS Import and Export Wizard.
If you don't have Visual Studio installed, or you have Visual Studio but don't have SQL Server Data Tools installed,
see Download SQL Server Data Tools (SSDT).

Get the wizard


If you want to run the wizard, but you don't have Microsoft SQL Server installed on your computer, you can install
the SQL Server Import and Export Wizard by installing SQL Server Data Tools (SSDT). For more info, see Download
SQL Server Data Tools (SSDT).

Get help while the wizard is running


TIP
Tap the F1 key from any page or dialog box of the wizard to see documentation for the current page.

What's next?
When you start the wizard, the first page is Welcome to SQL Server Import and Export Wizard. You don't have
to take any action on this page. For more info, see Welcome to SQL Server Import and Export Wizard.

Related tasks and content


Here are some other basic tasks.
See a quick example of how the wizard works.
If you prefer to see screen shots. Take a look at this simple end-to-end example on a single page -
Get started with this simple example of the Import and Export Wizard.
If you prefer to watch a video. Watch this four-minute video from YouTube that demonstrates the
wizard and explains clearly and simply how to export data to Excel - Using the SQL Server Import
and Export Wizard to Export to Excel.
Learn more about how the wizard works.
Learn more about the wizard. If you're looking for an overview of the wizard, see Import and
Export Data with the SQL Server Import and Export Wizard.
Learn about the steps in the wizard. If you're looking for info about the steps in the wizard, see
Steps in the SQL Server Import and Export Wizard. There's also a separate page of documentation
for each page of the wizard.
Learn how to connect to data sources and destinations. If you're looking for info about how to
connect to your data, select the page you want from the list here - Connect to data sources with the
SQL Server Import and Export Wizard. There's a separate page of documentation for each of several
commonly used data sources.
Connect to Data Sources with the SQL Server Import
and Export Wizard
11/20/2017 • 2 min to read • Edit Online

The topics in this section show you how to connect to many commonly used data sources when you run the SQL
Server Import and Export Wizard. You have to provide connection info for your data sources on the Choose a
Data Source and Choose a Destination pages of the wizard.
The topics in this section describe only how to connect to data sources from the Choose a Data Source and
Choose a Destination pages of the wizard. If you're looking for something else, see Related tasks and content.

Connect to a commonly used data source


Click a link to learn more about connecting to one of the following commonly used data sources.
SQL Server
Oracle
Flat files (text files)
Excel
Access
Azure Blob Storage
ODBC
PostgreSQL
MySQL

Connect to other data providers


For info about how to connect to a data source that's not listed here, see The Connection Strings Reference. This
third-party site contains sample connection strings and more info about data providers and the connection info
they require.

Related tasks and content


Here are some other basic tasks.
See a quick example of how the wizard works.
If you prefer to see screen shots. Take a look at this simple end-to-end example on a single page -
Get started with this simple example of the Import and Export Wizard.
If you prefer to watch a video. Watch this four-minute video from YouTube that demonstrates the
wizard and explains clearly and simply how to export data to Excel - Using the SQL Server Import
and Export Wizard to Export to Excel.
Learn more about how the wizard works.
Learn more about the wizard. If you're looking for an overview of the wizard, see Import and
Export Data with the SQL Server Import and Export Wizard.
Learn about the steps in the wizard. If you're looking for info about the steps in the wizard, see
Steps in the SQL Server Import and Export Wizard. There's also a separate page of documentation
for each page of the wizard.
Start the wizard. If you're ready to run the wizard and just want to know how to start it, see Start the SQL
Server Import and Export Wizard.
Get the wizard. If you want to run the wizard, but you don't have Microsoft SQL Server installed on your
computer, you can install the SQL Server Import and Export Wizard by installing SQL Server Data Tools
(SSDT). For more info, see Download SQL Server Data Tools (SSDT).

See also
Choose a Data Source
Choose a Destination
Connect to a SQL Server Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 4 min to read • Edit Online

This topic shows you how to connect to a Microsoft SQL Server data source from the Choose a Data Source or
Choose a Destination page of the SQL Server Import and Export Wizard. There are several data providers that
you can use to connect to SQL Server.

TIP
If you're on a network with multiple servers, it may be easier to enter the server name rather than expand the drop-down
list of servers. If you click the drop-down list, it may take a lot of time to query the network for all available servers, and the
results may not even include the server you want.

Connect to SQL Server with the .NET Framework Data Provider for
SQL Server
After you select .NET Framework Data Provider for SQL Server on the Choose a Data Source or Choose a
Destination page of the wizard, the page displays a grouped list of options for the provider. Many of these are
unfriendly names and unfamiliar settings. Fortunately, to connect to any enterprise database, you typically have to
provide only a few pieces of information. You can ignore the default values for the other settings.

NOTE
The connection options for this data provider are the same whether SQL Server is your source or your destination. That is,
the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

REQUIRED INFO .NET FRAMEWORK DATA PROVIDER FOR SQL SERVER PROPERTY

Server name Data Source

Authentication (login) info Integrated Security; or, User ID and Password


If you want to see a drop-down list of databases on the
server, you first have to provide valid login info.

Database name Initial Catalog


Options to specify (.NET Framework Data Provider for SQL Server)

NOTE
The connection options for this data provider are the same whether SQL Server is your source or your destination. That is,
the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

Data Source
Enter the name or IP address of the source or destination server, or select a server from the drop-down list.
To specify a non-standard TCP port, enter a comma after the server name or IP address, then enter the port
number.
Initial Catalog
Enter the name of the source or destination database, or select a database from the drop-down list.
Integrated Security
Specify True to connect with Windows integrated authentication (recommended), or False to connect with SQL
Server authentication. If you specify False, you must enter a user ID and password. The default value is False.
User ID
Enter a user name if you're using SQL Server authentication.
Password
Enter the password if you're using SQL Server authentication.

Connect to SQL Server with the ODBC driver for SQL Server
ODBC drivers aren't listed in the drop-down list of data sources. To connect with an ODBC driver, start by
selecting the .NET Framework Data Provider for ODBC as the data source. This provider acts as a wrapper
around the ODBC driver.

TIP
Get the latest driver. Download the Microsoft ODBC Driver 13 for SQL Server.

Here's the generic screen that you see immediately after selecting the .NET Framework Data Provider for ODBC.

Options to specify (ODBC driver for SQL Server)

NOTE
The connection options for the ODBC driver are the same whether SQL Server is your source or your destination. That is,
the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

To connect to SQL Server with the latest ODBC driver, assemble a connection string that includes the following
settings and their values. The format of a complete connection string immediately follows the list of settings.

TIP
Get help assembling a connection string that's just right. Or, instead of providing a connection string, provide an existing
DSN (data source name) or create a new one. For more info about these options, see Connect to an ODBC Data Source.

Driver
The name of the ODBC driver. The name is different for different versions of the driver.
Server
The name of the SQL Server.
Database
The name of the database.
Trusted_Connection; or, Uid and Pwd
Specify Trusted_Connection=Yes to connect with Windows integrated authentication; or, specify Uid (user id)
and Pwd (password) to connect with SQL Server authentication.
Connection string format
Here's the format of a connection string that uses Windows integrated authentication.

`Driver={ODBC Driver 13 for SQL Server};server=<server>;database=<database>;trusted_connection=Yes;`

Here's the format of a connection string that uses SQL Server authentication instead of Windows integrated
authentication.

`Driver={ODBC Driver 13 for SQL Server};server=<server>;database=<database>;uid=<user id>;pwd=<password>;`

Enter the connection string


Enter the connection string in the ConnectionString field, or enter the DSN name in the Dsn field, on the
Choose a Data Source or Choose a Destination page. After you enter the connection string, the wizard parses
the string and displays the individual properties and their values in the list.
The following example uses this connection string.

`Driver={ODBC Driver 13 for SQL Server};server=localhost;database=WideWorldImporters;trusted_connection=Yes;`

Here's the screen that you see after entering the connection string.
Connect to SQL Server with the Microsoft OLE DB Provider for SQL
Server or SQL Server Native Client
IMPORTANT
The Microsoft OLE DB Provider for SQL Server and SQL Server Native Client are not supported in versions of SQL Server
after SQL Server 2012. Use the ODBC driver instead. To learn more about the transition to the ODBC driver, see the
following blog posts.
Microsoft is Aligning with ODBC for Native Relational Data Access
Introducing the new Microsoft ODBC Drivers for SQL Server

Other data providers and more info


For info about how to connect to SQL Server with a data provider that's not listed here, see SQL Server connection
strings. This third-party site also contains more info about the data providers and the connection parameters
described on this page.

See also
Choose a Data Source
Choose a Destination
Connect to an Oracle Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 3 min to read • Edit Online

This topic shows you how to connect to an Oracle data source from the Choose a Data Source or Choose a
Destination page of the SQL Server Import and Export Wizard. There are several data providers that you can use
to connect to Oracle.

IMPORTANT
The detailed requirements and prerequisites for connecting to an Oracle database are beyond the scope of this Microsoft
article. This article assumes that you already have Oracle client software installed and that you can already connect
successfully to the target Oracle database. For more info, consult your Oracle database administrator or the Oracle
documentation.

Connect to Oracle with the .Net Framework Data Provider for Oracle
After you select .NET Framework Data Provider for Oracle on the Choose a Data Source or Choose a
Destination page of the wizard, the page presents a grouped list of options for the provider. Many of these are
unfriendly names and unfamiliar settings. Fortunately, you only have to provide two or three pieces of
information. You can ignore the default values for the other settings.

NOTE
The connection options for this data provider are the same whether Oracle is your source or your destination. That is, the
options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

REQUIRED INFO .NET FRAMEWORK DATA PROVIDER FOR ORACLE PROPERTY

Server name Data Source

Authentication (login) info User ID and Password; or, Integrated Security

You don't have to enter the connection string in the ConnectionString field of the list. After you enter individual
values for the Oracle server name (Data Source) and login info, the wizard assembles the connection string from
the individual properties and their values.
Connect to Oracle with the Microsoft ODBC driver for Oracle
ODBC drivers aren't listed in the drop-down list of data sources. To connect with an ODBC driver, start by selecting
the .NET Framework Data Provider for ODBC as the data source on the Choose a Data Source or Choose a
Destination page. This provider acts as a wrapper around the ODBC driver.
Here's the generic screen that you see immediately after selecting the .NET Framework Data Provider for ODBC.
Options to specify (ODBC Driver for Oracle )

NOTE
The connection options for this data provider and ODBC driver are the same whether Oracle is your source or your
destination. That is, the options you see are the same on both the Choose a Data Source and the Choose a Destination
pages of the wizard.

To connect to Oracle with the ODBC Driver for Oracle, assemble a connection string that includes the following
settings and their values. The format of a complete connection string immediately follows the list of settings.

TIP
Get help assembling a connection string that's just right. Or, instead of providing a connection string, provide an existing
DSN (data source name) or create a new one. For more info about these options, see Connect to an ODBC Data Source.

Driver
The name of the ODBC driver, Microsoft ODBC for Oracle.
Server
The name of the Oracle server.
Uid and Pwd
The user id and password to connect.
Connection string format
Here's the format of a typical connection string.
```
Driver={Microsoft ODBC for Oracle};Server=myServerAddress;Uid=myUsername;Pwd=myPassword;
```

Enter the connection string


Enter the connection string in the ConnectionString field, or enter the DSN name in the Dsn field, on the Choose
a Data Source or Choose a Destination page. After you enter the connection string, the wizard parses the string
and displays the individual properties and their values in the list.
Here's the screen that you see after entering the connection string.

What's my Oracle server name?


Run one of the following queries to get the name of your Oracle server.
SELECT host_name FROM v$instance

or
SELECT sys_context('USERENV','SERVER_HOST') FROM dual

Other data providers and more info


For info about how to connect to Oracle with a data provider that's not listed here, see Oracle connection strings.
This third-party site also contains more info about the data providers and the connection parameters described on
this page.

See also
Choose a Data Source
Choose a Destination
Connect to a Flat File Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 11 min to read • Edit Online

This topic shows you how to connect to a flat file (text file) data source from the Choose a Data Source or
Choose a Destination page of the SQL Server Import and Export Wizard. For flat files, these two pages of the
wizard present different sets of options, so this topic describes the flat file source and the flat file destination
separately.

An alternative for simple text import


If you have to import a text file into SQL Server, and you don't need all the configuration options available in the
Import and Export Wizard, consider using the Import Flat File Wizard in SQL Server Management Studio
(SSMS). For more info, see the following articles:
What’s new in SQL Server Management Studio 17.3
Introducing the new Import Flat File Wizard in SSMS 17.3

Connect to a flat file source


There are four pages of options for flat file data sources. That's a lot of pages! But you don't have to spend a lot of
time on each page. Here are the tasks to consider.

PAGE RECOMMENDATION TYPE

General Make sure you update the options in Recommended


the Format section.

Columns Make sure you check the column and Recommended


row delimiters (for a Delimited file) or
mark the columns (for a Fixed Width
file).

Advanced Optionally, check the data types and Optional


other properties assigned by default to
the columns.

Preview Optionally, preview a sample of the Optional


data, using the settings that you
specified.

General page (source)


On the General page, browse to select the file, then verify the settings in the Format section.
Options to specify (General page )
File name
Enter the path and file name of the flat file.
Browse
Locate the flat file.
Locale
Specify the locale to provide language-specific information for sorting and for date and time formats.
Unicode
Specify whether the file uses Unicode. If you use Unicode, you can't specify a code page.
Code page
Specify the code page for non-Unicode text.
Format
Select whether the file uses delimited, fixed width, or ragged right formatting.

VALUE DESCRIPTION

Delimited Columns are separated by delimiters. You specify the delimiter


on the Columns page.

Fixed width Columns have a fixed width.

Ragged right Ragged right files are files in which every column has a fixed
width, except for the last column, which is delimited by the
row delimiter.

Text qualifier
Specify the text qualifier, if any, used by the file. For example, you can specify that text fields are enclosed in
quotation marks. (This property only applies to Delimited files.)
NOTE
After you select a text qualifier, you can't re-select the None option. Type None to de-select the text qualifier.

Header row delimiter


Select from the list of delimiters for header rows, or enter the delimiter text.

VALUE DESCRIPTION

{CR}{LF} The header row is delimited by a carriage return-line feed


combination.

{CR} The header row is delimited by a carriage return.

{LF} The header row is delimited by a line feed.

Semicolon {;} The header row is delimited by a semicolon.

Colon {:} The header row is delimited by a colon.

Comma {,} The header row is delimited by a comma.

Tab {t} The header row is delimited by a tab.

Vertical bar {|} The header row is delimited by a vertical bar.

Header rows to skip


Specify the number of rows to skip at the top of the file, if any.
Column names in the first data row
Specify whether the first row (after any skipped rows) contains column names.

Columns page - Format = Delimited (source)


On the Columns page, verify the list of columns and the delimiters that the wizard has identified. The following
screen shot shows the page when you've selected Delimited as the flat file format.
Options to specify (Columns page - Format = Delimited)
Row delimiter
Select from the list of available row delimiters, or enter the delimiter text.

VALUE DESCRIPTION

{CR}{LF} Rows are delimited by a carriage return-line feed combination.

{CR} Rows are delimited by a carriage return.

{LF} Rows are delimited by a line feed.

Semicolon {;} Rows are delimited by a semicolon.

Colon {:} Rows are delimited by a colon.

Comma {,} Rows are delimited by a comma.

Tab {t} Rows are delimited by a tab.

Vertical bar {|} Rows are delimited by a vertical bar.


Column delimiter
Select from the list of available column delimiters, or enter the delimiter text.

VALUE DESCRIPTION

{CR}{LF} Columns are delimited by a carriage return-line feed


combination.

{CR} Columns are delimited by a carriage return.

{LF} Columns are delimited by a line feed.

Semicolon {;} Columns are delimited by a semicolon.

Colon {:} Columns are delimited by a colon.

Comma {,} Columns are delimited by a comma.

Tab {t} Columns are delimited by a tab.

Vertical bar {|} Columns are delimited by a vertical bar.

Preview rows
View sample data in the flat file, divided into columns and rows by using the options selected.
Refresh
View the effect of changing the delimiters to skip by clicking Refresh. This button only becomes visible after you
have changed other connection options.
Reset Columns
Restore the original columns.

Columns page - Format = Fixed Width (source)


On the Columns page, verify the list of columns and the delimiters that the wizard has identified. The following
screen shot shows the page when you've selected Fixed Width as the flat file format.
Options to specify (Columns page - Format = Fixed Width)
Font
Select the font in which to display the preview data.
Source data columns
Adjust the width of the row by sliding the vertical red row marker, and adjust the width of the columns by clicking
the ruler at the top of the preview window
Row width
Specify the length of the row before adding delimiters for individual columns. Or, drag the vertical red line in the
preview window to mark the end of the row. The row width value is automatically updated.
Reset Columns
Restore the original columns.

Columns page - Format = Ragged Right (source)


On the Columns page, verify the list of columns and the delimiters that the wizard has identified. The following
screen shot shows the page when you've selected Ragged Right as the flat file format.
NOTE
Ragged right files are files in which every column has a fixed width, except for the last column, which is delimited by the row
delimiter.

Options to specify (Columns page - Format = Ragged Right)


Font
Select the font in which to display the preview data.
Source data columns
Adjust the width of the row by sliding the vertical red row marker, and adjust the width of the columns by clicking
the ruler at the top of the preview window
Row delimiter
Select from the list of available row delimiters, or enter the delimiter text.

VALUE DESCRIPTION

{CR}{LF} Rows are delimited by a carriage return-line feed combination.

{CR} Rows are delimited by a carriage return.


VALUE DESCRIPTION

{LF} Rows are delimited by a line feed.

Semicolon {;} Rows are delimited by a semicolon.

Colon {:} Rows are delimited by a colon.

Comma {,} Rows are delimited by a comma.

Tab {t} Rows are delimited by a tab.

Vertical bar {|} Rows are delimited by a vertical bar.

Reset Columns
Restore the original columns.

Advanced page (source)


The Advanced page shows detailed info about each column in the data source, including its data type and size.
The following screen shot shows the Advanced page for the first column in a delimited flat file.
In the screen shot, notice that the id column, which contains numbers, initially has a data type of string.
Options to specify (Advanced page )
Configure the properties of each column
Select a column in the left pane to view its properties in the right pane. See the following table for a description of
column properties. Some of the properties listed are configurable only for certain flat file formats and for columns
of certain data types.

PROPERTY DESCRIPTION

Name Provide a descriptive column name. If you do not enter a


name, Integration Services automatically creates a name in
the format Column 0, Column 1, and so forth.

ColumnDelimiter Select from the list of available column delimiters. Choose


delimiters that are not likely to occur in the text. This value is
ignored for fixed-width columns.

{CR}{LF}. Columns are delimited by a carriage return-line feed


combination.

{CR}. Columns are delimited by a carriage return.

{LF}. Columns are delimited by a line feed.

Semicolon {;}. Columns are delimited by a semicolon.

Colon {:}. Columns are delimited by a colon.

Comma {,}. Columns are delimited by a comma.

Tab {t}. Columns are delimited by a tab.

Vertical bar {|}. Columns are delimited by a vertical bar.

ColumnType Denotes whether the column is delimited, fixed width, or


ragged right. This property is read-only. Ragged right files are
files in which every column has a fixed width, except for the
last column. It is delimited by the row delimiter.

InputColumnWidth Specify a value to be stored as a count of bytes; for Unicode


files, this value is a count of characters. This value is ignored
for delimited columns.

Note In the object model, the name of this property is


ColumnWidth.

DataPrecision Specify the precision of numeric data. Precision refers to the


number of digits.

DataScale Specify the scale of numeric data. Scale refers to the number
of decimal places.

DataType Select from the list of available data types.


For more information, see Integration Services Data Types.
PROPERTY DESCRIPTION

OutputColumnWidth Specify a value to be stored as a count of bytes; for Unicode


files, this value corresponds to a count of characters. In the
Data Flow task, this value is used to set the output column
width for the Flat File source. In the object model, the name of
this property is MaximumWidth.

TextQualified Indicate whether text data is surrounded by text qualifier


characters such as quote characters.

True: Text data in the flat file is qualified. False: Text data in the
flat file is NOT qualified.

New
Add a new column by clicking New. By default, the New button adds a new column at the end of the list. The
button also has the following options, available in the drop-down list.

VALUE DESCRIPTION

Add Column Add a new column at the end of the list.

Insert Before Insert a new column before the selected column.

Insert After Insert a new column after the selected column.

Delete
Select a column, and then remove it by clicking Delete.
Suggest Types
Use the Suggest Column Types dialog box to evaluate sample data in the file and to obtain suggestions for the
data type and length of each column.
Click Suggest types to display the Suggest Column Types dialog box.

After you choose options in the Suggest Column Types dialog box and click OK, the wizard may change the data
types of some of the columns.
The following screen shot shows that, after you click Suggest types, the wizard has recognized that the id column
in the data source is in fact a number and not a text string, and has changed the data type of the column from a
string to an integer.
For more info, see Suggest Column Types Dialog Box UI Reference.

Preview page (source)


On the Preview page, verify that the list of columns and the sample data are what you expect.
Options to specify (Preview page )
Data rows to skip
Specify how many rows to skip at the beginning of the flat file.
Preview rows
View sample data in the flat file, divided into columns and rows according to the options you have selected.
Refresh
View the effect of changing the number of rows to skip by clicking Refresh. This button only becomes visible after
you have changed other connection options.
For more info about the Preview page, see the following Integration Services reference page - Flat File
Connection Manager Editor (Preview Page).

Connect to a flat file destination


For a flat file destination, there's only a single page of options, as shown in the following screen shot. Browse to
select the file, then verify the settings in the Format section.
Options to specify (Choose a Destination page )
File name
Enter the path and file name of the flat file.
Browse
Locate the flat file.
Locale
Specify the locale to provide language-specific information for sorting and for date and time formats.
Unicode
Specify whether the file uses Unicode. If you use Unicode, you can't specify a code page.
Code page
Specify the code page for non-Unicode text.
Format
Select whether the file uses delimited, fixed width, or ragged right formatting.

VALUE DESCRIPTION

Delimited Columns are separated by delimiters. You specify the delimiter


on the Columns page.
VALUE DESCRIPTION

Fixed width Columns have a fixed width.

Ragged right Ragged right files are files in which every column has a fixed
width, except for the last column, which is delimited by the
row delimiter.

Text qualifier
Specify the text qualifier, if any, used by the file. For example, you can specify that text fields are enclosed in
quotation marks. (This property only applies to Delimited files.)

NOTE
After you select a text qualifier, you can't reselect the None option. Type None to de-select the text qualifier.

See also
Choose a Data Source
Choose a Destination
Connect to an Excel Data Source (SQL Server Import
and Export Wizard)
11/20/2017 • 2 min to read • Edit Online

This topic shows you how to connect to a Microsoft Excel data source from the Choose a Data Source or
Choose a Destination page of the SQL Server Import and Export Wizard.
The following screen shot shows a sample connection to a Microsoft Excel workbook.

Options to specify
NOTE
The connection options for this data provider are the same whether Excel is your source or your destination. That is, the
options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

Excel file path


Specify the path and file name for the Excel file. For example:
For a file on the local computer, C:\MyData.xlsx.
For a file on a network share, \\Sales\Database\Northwind.xlsx.
Or, click Browse.
Browse
Locate the spreadsheet by using the Open dialog box.
NOTE
The wizard can't open a password-protected Excel file.

Excel version
Select the version of Excel that's used by the source workbook.

IMPORTANT
You may have to download and install additional files to connect to Excel files. See Get the files you need to connect to Excel
on this page for more info.

First row has column names


Indicate whether the first row of the data contains column names.
If the data doesn't contain column names but you enable this option, the wizard treats the first row of source
data as the column names.
If the data contains column names but you disable this option, the wizard treats the row of column names as
the first row of data.
If you specify that the data doesn't have column names, the wizard uses F1, F2, and so forth, as column headings.

I don't see Excel in the list of data sources


If you don't see Excel in the list of data sources, are you running the 64-bit wizard? The providers for Excel and
Access are typically 32-bit and aren't visible in the 64-bit wizard. Run the 32-bit wizard instead.

NOTE
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data
Tools (SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the
32-bit version of the wizard.

Get the files you need to connect to Excel


You may have to download the connectivity components for Microsoft Office data sources, including Excel and
Access, if they're not already installed. Download the latest version of the connectivity components for both Excel
and Access files here: Microsoft Access Database Engine 2016 Redistributable.
The latest version of the components can open files created by earlier versions of Excel.
If the computer has a 32-bit version of Office, then you have to install the 32-bit version of the components, and
you also have to ensure that you run the package in 32-bit mode.
If you have an Office 365 subscription, make sure that you download the Access Database Engine 2016
Redistributable and not the Microsoft Access 2016 Runtime. When you run the installer, you may see an error
message that you can't install the download side-by-side with Office click-to-run components. To bypass this
error message, run the installation in quiet mode by opening a Command Prompt window and running the .EXE
file that you downloaded with the /quiet switch. For example:
C:\Users\<user name>\Downloads\AccessDatabaseEngine.exe /quiet

See also
Choose a Data Source
Choose a Destination
Connect to an Access Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 4 min to read • Edit Online

This topic shows you how to connect to a Microsoft Access data source from the Choose a Data Source or
Choose a Destination page of the SQL Server Import and Export Wizard.
The following screen shot shows a sample connection to a Microsoft Access database. In this example, you don't
have to enter a user name and password, because the target database doesn't use a workgroup information file.

Options to specify
NOTE
The connection options for this data provider are the same whether Access is your source or your destination. That is, the
options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.
Data source
The list of data providers may contain several entries for Microsoft Access. Select the latest installed version, or the
version that corresponds to the version of Access that created the database file.

DATA SOURCE OFFICE VERSION

Microsoft Access (Microsoft.ACE.OLEDB.16.0) Office 2016

Microsoft Access (Microsoft.ACE.OLEDB.15.0) Office 2013

Microsoft Access (Microsoft Access Database Engine) Office 2010 and Office 2007

Microsoft Access (Microsoft Jet Database Engine) Office versions earlier than Office 2007

IMPORTANT
You may have to download and install additional files to connect to Access databases. See Get the files you need to connect
to Access on this page for more info.

File name
Specify the path and file name for the Access file. For example, C:\MyData.mdb for a file on the local computer,
or \\Sales\Database\Northwind.mdb for a file on a network share. Or, click Browse.

NOTE
If you click Browse to locate the Access file, the Open dialog box filters for files with the older .MDB format and file
extension by default. However the data provider can also open files with the newer .ACCDB format and file extension.

Browse
Locate the database file by using the Open dialog box.
User name
If a workgroup information file is associated with the database, provide a valid user name.
Password
If a workgroup information file is associated with the database, provide the user's password here.
If the database is protected with a single password for all users, see Is the database file password-protected?.
Advanced
Specify advanced options, such as the database password or a non-default workgroup information file, in the
Data Link Properties dialog box.

I don't see Access in the list of data sources


If you don't see Access in the list of data sources, are you running the 64-bit wizard? The providers for Excel and
Access are typically 32-bit and aren't visible in the 64-bit wizard. Run the 32-bit wizard instead.

NOTE
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data Tools
(SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the 32-bit
version of the wizard.
Get the files you need to connect to Access
You may have to download the connectivity components for Microsoft Office data sources, including Access and
Excel, if they're not already installed. Download the latest version of the connectivity components for both Access
and Excel files here: Microsoft Access Database Engine 2016 Redistributable.
The latest version of the components can open files created by earlier versions of Access.
If the computer has a 32-bit version of Office, then you have to install the 32-bit version of the components, and
you also have to ensure that you run the package in 32-bit mode.
If you have an Office 365 subscription, make sure that you download the Access Database Engine 2016
Redistributable and not the Microsoft Access 2016 Runtime. When you run the installer, you may see an error
message that you can't install the download side-by-side with Office click-to-run components. To bypass this error
message, run the installation in quiet mode by opening a Command Prompt window and running the .EXE file that
you downloaded with the /quiet switch. For example:
C:\Users\<user name>\Downloads\AccessDatabaseEngine.exe /quiet

Is the database file password-protected?


In some cases, an Access database is password-protected, but isn't using a workgroup information file. All users
have to provide the same password, but don't have to enter a user name. To provide a database password, do the
following.
1. On the Choose a Data Source or Choose a Destination page, click the Advanced button to open the Data
Link Properties dialog box.
2. In the Data Link Properties dialog box, select the All tab.
3. In the list of properties and values, select Jet OLEDB:Database Password.
4. Click Edit Value to open the Edit Property Value dialog box.

5. In the Edit Property Value dialog box, enter the database password.
6. Click OK in each dialog box to return to the Choose a Data Source or Choose a Destination page of the
wizard and continue.

Keep your autonumber values when you export from Access


To allow existing identity values in the source data to be inserted into an identity column in the destination table,
choose the Enable identity insert option in the Column Mappings dialog box. By default, the destination
identity column typically doesn't let you insert existing values. To show the Column Mappings dialog box, select
Edit mappings when you reach the Select Source Tables and Views page of the wizard. To look at these pages,
see Select Source Tables and Views and Column Mappings.
If your existing primary keys are in an identity column, an autonumber column, or the equivalent, you typically
have to select this option to keep your existing primary key values. Otherwise the destination identity column
typically assigns new values.

See also
Choose a Data Source
Choose a Destination
Connect to Azure Blob Storage (SQL Server Import
and Export Wizard)
11/20/2017 • 1 min to read • Edit Online

This topic shows you how to connect to an Azure Blob Storage data source from the Choose a Data Source or
Choose a Destination page of the SQL Server Import and Export Wizard.

NOTE
To use the Azure Blob Source or Destination, you have to install the Azure Feature Pack for SQL Server Integration Services.
To download the Feature Pack, see Microsoft SQL Server 2016 Integration Services Feature Pack for Azure.
For more info, see Azure Feature Pack for Integration Services (SSIS).

The following screen shot shows the options to configure for a connection to Azure Blob Storage.

Options to specify
NOTE
The connection options for this data provider are the same whether Azure Blob Storage is your source or your destination.
That is, the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the
wizard.

Use Azure account


Specify whether to use an online account.
Storage account name
Enter the name of the Azure storage account.
Account key
Enter the key for the Azure storage account.
Use HTTPS
Specify whether to use HTTP or HTTPS to connect to the storage account.
Use local developer account
Specify whether to use the storage emulator on the local computer.
Blob container name
Select from the list of storage containers available in the specified storage account.
Blob file format
Select Text or Avro file format.
Column delimiter character
If you selected Text format, enter the column delimiter character.
Use first row as column names
Specify whether the first row of data contains column names.

See also
Choose a Data Source
Choose a Destination
Connect to an ODBC Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 8 min to read • Edit Online

This topic shows you how to connect to an ODBC data source from the Choose a Data Source or Choose a
Destination page of the SQL Server Import and Export Wizard.
You may have to download the ODBC driver you need from Microsoft or from a third party.
You may also have to look up the required connection info that you have to provide. This third-party site - The
Connection Strings Reference - contains sample connection strings and more info about data providers and the
connection info they require.

Make sure the driver you want is installed


1. Search for or browse to the ODBC Data Sources (64-bit) applet in the Control Panel. If you only have a 32-
bit driver, or you know that you have to use a 32-bit driver, search for or browse to ODBC Data Sources (32-
bit) instead.
2. Launch the applet. The ODBC Data Source Administrator window opens.
3. On the Drivers tab, you can find a list of all the ODBC drivers installed on your computer. (The names of
some of the drivers may be listed in multiple languages.)
Here's an example of the list of installed 64-bit drivers.
TIP
If you know that your driver's installed and you don't see it in the 64-bit applet, look in the 32-bit applet instead. This also
tells you whether you have to run the 64-bit or 32-bit SQL Server Import and Export Wizard.
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data
Tools (SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the
32-bit version of the wizard.

Step 1 - Select the data source


The ODBC drivers installed on your computer aren't listed in the drop-down list of data sources. To connect with
an ODBC driver, start by selecting the .NET Framework Data Provider for ODBC as the data source on the
Choose a Data Source or Choose a Destination page of the wizard. This provider acts as a wrapper around
the ODBC driver.
Here's the generic screen that you see immediately after selecting the .NET Framework Data Provider for ODBC.

Step 2 - Provide the connection info


The next step is to provide the connection info for your ODBC driver and your data source. You have two options.
1. Provide a DSN (data source name) that already exists or that you create with the ODBC Data Source
Administrator applet in the Control Panel. A DSN is the saved collection of settings required to connect
to an ODBC data source.
If you already know the DSN name, or know how to create a new DSN now, you can skip the rest of this
page. Enter the DSN name in the Dsn field on the Choose a Data Source or Choose a Destination
page, then continue to the next step of the wizard.
Provide a DSN
2. Provide a connection string, which you can look up online, or create and test on your computer with the
ODBC Data Source Administrator applet.
If you already have the connection string or know how to create it, you can skip the rest of this page. Enter
the connection string in the ConnectionString field on the Choose a Data Source or Choose a
Destination page, then continue to the next step of the wizard.
Provide a connection string
If you provide a connection string, the Choose a Data Source or Choose a Destination page displays all the
connection info that the wizard is going to use to connect to your data source, such as server and database name
and authentication method. If you provide a DSN, this information isn't visible.

Option 1 - Provide a DSN


If you want to provide the connection information with a DSN (data source name), use the ODBC Data Source
Administrator applet to find the name of the existing DSN, or to create a new DSN.
1. Search for or browse to the ODBC Data Sources (64-bit) applet in the Control Panel. If you only have a 32-
bit driver, or have to use a 32-bit driver, search for or browse to ODBC Data Sources (32-bit) instead.
2. Launch the applet. The ODBC Data Source Administrator window opens. Here's what the applet looks
like.

3. If you want to use an existing DSN for your data source, you can use any DSN that you see on the User
DSN, System DSN, or File DSN tab. Check the name, then go back to the wizard and enter it in the Dsn
field on the Choose a Data Source or Choose a Destination page. Skip the rest of this page and
continue to the next step of the wizard.
4. If you want to create a new DSN, decide whether you want it to be visible only to you (User DSN), visible to
all users of the computer including Windows services (System DSN), or saved in a file (File DSN). This
example creates a new System DSN.
5. On the System DSN tab, click Add.
6. In the Create a New Data Source dialog box, select the driver for your data source, then click Finish.

7. The driver now displays one or more driver-specific screens where you enter the info needed to connect
to your data source. (For the SQL Server driver, for example, there are four pages of custom settings.)
After you finish, the new system DSN appears in the list.
8. Go back to the wizard and enter the DSN name in the Dsn field on the Choose a Data Source or Choose
a Destination page. Continue to the next step of the wizard.

Option 2 - Provide a connection string


If you want to provide your connection information with a connection string, the rest of this topic helps you get
the connection string you need.
This example is going to use the following connection string, which connects to Microsoft SQL Server.

```
Driver={ODBC Driver 13 for SQL Server};server=localhost;database=WideWorldImporters;trusted_connection=Yes;
```

Enter the connection string in the ConnectionString field on the Choose a Data Source or Choose a
Destination page. After you enter the connection string, the wizard parses the string and displays the individual
properties and their values in the list.
Here's the screen that you see after entering the connection string.
NOTE
The connection options for an ODBC driver are the same whether you're configuring your source or your destination. That
is, the options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the
wizard.

Get the connection string online


To find connection strings for your ODBC driver online, see The Connection Strings Reference. This third-party
site contains sample connection strings and more info about data providers and the connection info they require.

Get the connection string with an app


To build and test the connection string for your ODBC driver on your own computer, you can use the ODBC
Data Source Administrator applet in the Control Panel. Create a File DSN for your connection, then copy
settings out of the File DSN to assemble the connection string. This requires several steps, but helps to make sure
you have a valid connection string.
1. Search for or browse to the ODBC Data Sources (64-bit) applet in the Control Panel. If you only have a 32-
bit driver, or have to use a 32-bit driver, search for or browse to ODBC Data Sources (32-bit) instead.
2. Launch the applet. The ODBC Data Source Administrator window opens.
3. Now go to the File DSN tab of the applet. Click Add.
For this example, create a File DSN rather than a User DSN or System DSN, because the File DSN saves
the name-value pairs in the specific format required for the connection string.
4. In the Create New Data Source dialog box, select your driver in the list, and then click Next. This
example is going to create a DSN that contains the connection string arguments we need to connect to
Microsoft SQL Server.

5. Select a location and enter a filename for the new File DSN, and then click Next. Remember where you
save the file so you can find it and open it in a subsequent step.
6. Review the summary of your selections, and then click Finish.
7. After you click Finish, the driver that you selected displays one or more proprietary screens to gather the
info it needs to connect. Typically this info includes server, login info, and database for server-based data
sources, and file, format, and version for file-based data sources.
8. After you configure your data source and click Finish, you typically see a summary of your selections and
have an opportunity to test them.

9. After you test your data source and close the dialog boxes, find the File DSN where you saved it in the file
system. If you didn't change the file extension, the default extension is .DSN.
10. Open the saved file with Notepad or another text editor. Here are the contents of our SQL Server example.
[ODBC]
DRIVER=ODBC Driver 13 for SQL Server
TrustServerCertificate=No
DATABASE=WideWorldImporters
WSID=<local computer name>
APP=Microsoft® Windows® Operating System
Trusted_Connection=Yes
SERVER=localhost

11. Copy and paste the necessary values into a connection string in which the name-value pairs are separated
by semi-colons.
After you assemble the necessary values from the sample file DSN, you have the following connection
string.

```
DRIVER=ODBC Driver 13 for SQL
Server;SERVER=localhost;DATABASE=WideWorldImporters;Trusted_Connection=Yes
```

You don't typically need all the settings in a DSN created by the ODBC Data Source Administrator to
create a connection string that works.
You always have to specify the ODBC driver.
For a server-based data source like SQL Server, you typically need Server, Database, and login
information. So in the sample DSN, you don't need TrustServerCertificate, WSID, or APP.
For a file-based data source, you need at least file name and location.
12. Paste this connection string into the ConnectionString field on the Choose a Data Source or Choose a
Destination page of the wizard. The wizard parses the string and you're ready to continue!
See also
Choose a Data Source
Choose a Destination
Connect to a PostgreSQL Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 2 min to read • Edit Online

This topic shows you how to connect to a PostgreSQL data source from the Choose a Data Source or Choose a
Destination page of the SQL Server Import and Export Wizard.

IMPORTANT
The detailed requirements and prerequisites for connecting to a PostgreSQL database are beyond the scope of this
Microsoft article. This article assumes that you already have PostgreSQL client software installed and that you can already
connect successfully to the target PostgreSQL database. For more info, consult your PostgreSQL database administrator or
the PostgreSQL documentation.

Get the PostgreSQL ODBC driver


Install the ODBC driver with Stack Builder
Run Stack Builder to add the PostgreSQL ODBC driver (psqlODBC) to your installation of PostgreSQL.

Or, download the latest ODBC driver


Or, download the Windows installer for the latest version of the PostgreSQL ODBC driver (psqlODBC) directly
from this FTP site - https://www.postgresql.org/ftp/odbc/versions/msi/. Extract the files from the .zip file and run
the .msi file.

Connect to PostgreSQL with the PostgreSQL ODBC driver (psqlODBC)


ODBC drivers aren't listed in the drop-down list of data sources. To connect with an ODBC driver, start by selecting
the .NET Framework Data Provider for ODBC as the data source on the Choose a Data Source or Choose a
Destination page. This provider acts as a wrapper around the ODBC driver.
Here's the generic screen that you see immediately after selecting the .NET Framework Data Provider for ODBC.

Options to specify (PostgreSQL ODBC driver)

NOTE
The connection options for this data provider and ODBC driver are the same whether PostgreSQL is your source or your
destination. That is, the options you see are the same on both the Choose a Data Source and the Choose a Destination
pages of the wizard.

To connect to PostgreSQL with the PostgreSQL ODBC driver, assemble a connection string that includes the
following settings and their values. The format of a complete connection string immediately follows the list of
settings.

TIP
Get help assembling a connection string that's just right. Or, instead of providing a connection string, provide an existing
DSN (data source name) or create a new one. For more info about these options, see Connect to an ODBC Data Source.

Driver
The name of the ODBC driver - either PostgreSQL ODBC Driver(UNICODE) or PostgreSQL ODBC
Driver(ANSI).
Server
The name of the PostgreSQL server.
Port
The port to use to connect to the PostgreSQL server.
Database
The name of the PostgreSQL database.
Uid and Pwd
The Uid (user id) and Pwd (password) to connect.
Connection string format
Here's the format of a typical connection string.

```
Driver={PostgreSQL ODBC Driver(UNICODE)};Server=<server>;Port=<port>;Database=<database>;UID=<user id>;PWD=
<password>
```

Enter the connection string


Enter the connection string in the ConnectionString field, or enter the DSN name in the Dsn field, on the Choose
a Data Source or Choose a Destination page. After you enter the connection string, the wizard parses the string
and displays the individual properties and their values in the list.
The following example uses this connection string.

```
Driver={PostgreSQL ODBC
Driver(UNICODE)};Server=127.0.0.1;Port=5432;Database=postgres;UID=postgres;PWD=********
```

Here's the screen that you see after entering the connection string.
Other data providers and more info
For info about how to connect to PostgreSQL with a data provider that's not listed here, see PostgreSQL
connection strings. This third-party site also contains more info about the data providers and the connection
parameters described on this page.

See also
Choose a Data Source
Choose a Destination
Connect to a MySQL Data Source (SQL Server
Import and Export Wizard)
11/20/2017 • 3 min to read • Edit Online

This topic shows you how to connect to an MySQL data source from the Choose a Data Source or Choose a
Destination page of the SQL Server Import and Export Wizard. There are several data providers that you can use
to connect to MySQL.

IMPORTANT
The detailed requirements and prerequisites for connecting to a MySQL database are beyond the scope of this Microsoft
article. This article assumes that you already have MySQL client software installed and that you can already connect
successfully to the target MySQL database. For more info, consult your MySQL database administrator or the MySQL
documentation.

Get the MySQL connectors


Download the providers and drivers described in this topic from the MySQL Connectors page.

Connect to MySQL with the .Net Framework Data Provider for MySQL
After you select .NET Framework Data Provider for MySQL on the Choose a Data Source or Choose a
Destination page of the wizard, the page presents a grouped list of options for the provider. Many of these are
unfriendly names and unfamiliar settings. Fortunately, you only have to provide a few pieces of information. You
can ignore the default values for the other settings.

NOTE
The connection options for this data provider are the same whether MySQL is your source or your destination. That is, the
options you see are the same on both the Choose a Data Source and the Choose a Destination pages of the wizard.

REQUIRED INFO .NET FRAMEWORK DATA PROVIDER FOR MYSQL PROPERTY

Server name Server

Database name Database

Authentication (login) info User Id and Password

You don't have to enter the connection string in the ConnectionString field of the list. After you enter individual
values for the MySQL server name (Server) and login info, the wizard assembles the connection string from the
individual properties and their values.
Connect to MySQL with the MySQL ODBC driver
ODBC drivers aren't listed in the drop-down list of data sources. To connect with an ODBC driver, start by selecting
the .NET Framework Data Provider for ODBC as the data source on the Choose a Data Source or Choose a
Destination page. This provider acts as a wrapper around the ODBC driver.
Here's the generic screen that you see immediately after selecting the .NET Framework Data Provider for ODBC.
Options to specify (MySQL ODBC Driver)

NOTE
The connection options for this data provider and ODBC driver are the same whether MySQL is your source or your
destination. That is, the options you see are the same on both the Choose a Data Source and the Choose a Destination
pages of the wizard.

To connect to MySQL with the MySQL ODBC driver, assemble a connection string that includes the following
settings and their values. The format of a complete connection string immediately follows the list of settings.

TIP
Get help assembling a connection string that's just right. Or, instead of providing a connection string, provide an existing
DSN (data source name) or create a new one. For more info about these options, see Connect to an ODBC Data Source.

Driver
The name of the ODBC driver.
Server
The name of the MySQL server.
Database
The name of the MySQL database.
UID and PWD
The user id and password to connect.
Connection string format
Here's the format of a typical connection string.

```
Driver={MySQL ODBC 5.3 Unicode Driver};Server=<server>;Database=<database>;UID=<user id>;PWD=<password>
```

Enter the connection string


Enter the connection string in the ConnectionString field, or enter the DSN name in the Dsn field, on the Choose
a Data Source or Choose a Destination page. After you enter the connection string, the wizard parses the string
and displays the individual properties and their values in the list.
The following example uses this connection string.

```
Driver={MySQL ODBC 5.3 Unicode Driver};Server=127.0.0.1;Database=world;UID=root;PWD=********
```

Here's the screen that you see after entering the connection string.

Other data providers and more info


For info about how to connect to MySQL with a data provider that's not listed here, see MySQL connection strings.
This third-party site also contains more info about the data providers and the connection parameters described on
this page.

See also
Choose a Data Source
Choose a Destination
Steps in the SQL Server Import and Export Wizard
11/20/2017 • 3 min to read • Edit Online

This topic describes the sequence of steps for importing and exporting data with the SQL Server Import and
Export Wizard. It also contains links to the individual pages of documentation that describe each page or dialog
box you see in the wizard.
This topic describes only the steps in the wizard. If you're looking for something else, see Related tasks and
content.

Steps for importing and exporting data


The following table lists the steps for importing and exporting data and the corresponding pages of the wizard.
Depending on the options that you select in the wizard, you typically don't see all these pages.
For a quick look at the several screens you see in a typical session, take a look at this simple end-to-end example
on a single page - Get started with this simple example of the Import and Export Wizard.

STEP WIZARD PAGES

Welcome Welcome to SQL Server Import and Export Wizard


You don't have to take any action on this page.

Pick the source of the data. Choose a Data Source

Pick the destination for the data. Choose a Destination

Configure the destination. (optional steps) Create Database

- Create a new destination database. Configure Flat File Destination


- If you're copying data to a text file, configure additional
settings.

Specify what you want to copy. Specify Table Copy or Query

Select Source Tables and Views

Provide a Source Query

Configure the copy operation. (optional steps) Create Table SQL Statement

- Create a new destination table. Convert Types without Conversion Checking


- Decide what to do if the wizard doesn't know how to map
data types between the source and destination that you Column Mappings
selected.
- Review column mappings between source and destination. Review Data Type Mapping
- Handle issues with converting data types between source
and destination. Column Conversion Details Dialog Box
- Preview the data to be copied.
Preview Data Dialog Box
STEP WIZARD PAGES

Copy the data. Save and Run Package

Optionally, save your settings as a SQL Server Integration Save SSIS Package
Services (SSIS) package.
Complete the Wizard

Performing Operation

TIP
Tap the F1 key from any page or dialog box of the wizard to see documentation for the current page.

Related tasks and content


Here are some other basic tasks.
See a quick example of how the wizard works.
If you prefer to see screen shots. Take a look at this simple end-to-end example on a single page -
Get started with this simple example of the Import and Export Wizard.
If you prefer to watch a video. Watch this four-minute video from YouTube that demonstrates the
wizard and explains clearly and simply how to export data to Excel - Using the SQL Server Import
and Export Wizard to Export to Excel.
Learn more about how the wizard works.
Learn more about the wizard. If you're looking for an overview of the wizard, see Import and
Export Data with the SQL Server Import and Export Wizard.
Learn how to connect to data sources and destinations. If you're looking for info about how to
connect to your data, select the page you want from the list here - Connect to data sources with the
SQL Server Import and Export Wizard. There's a separate page of documentation for each of several
commonly used data sources.
Start the wizard. If you're ready to run the wizard and just want to know how to start it, see Start the SQL
Server Import and Export Wizard.
Get the wizard. If you want to run the wizard, but you don't have Microsoft SQL Server installed on your
computer, you can install the SQL Server Import and Export Wizard by installing SQL Server Data Tools
(SSDT). For more info, see Download SQL Server Data Tools (SSDT).
Welcome to SQL Server Import and Export Wizard
11/20/2017 • 2 min to read • Edit Online

When you start the SQL Server Import and Export Wizard, the first page is Welcome to SQL Server Import and
Export Wizard. You don't have to take any action on this page.

IMPORTANT
This topic describes only the first page the wizard. If you're looking for something else, see Related tasks and content.

Prerequisite - Is the wizard installed on your computer?


If you want to run the wizard, but you don't have [!INCLUDEmsCoName.

Screen shot of the Welcome page


The following screen shot shows the Welcome to SQL Server Import and Export Wizard page of the wizard.

Don't show this page again


Do not show this starting page again.
Skip the welcome page the next time you run the wizard.

What's next?
After the Welcome page, the next page is Choose a Data Source. On this page, you provide info about the source
of your data and about how to connect to it. For more info, see Choose a Data Source.

Related tasks and content


Here are some other basic tasks.
See a quick example of how the wizard works.
If you prefer to see screen shots. Take a look at this simple end-to-end example on a single page -
Get started with this simple example of the Import and Export Wizard.
If you prefer to watch a video. Watch this four-minute video from YouTube that demonstrates the
wizard and explains clearly and simply how to export data to Excel - Using the SQL Server Import and
Export Wizard to Export to Excel.
Learn more about how the wizard works.
Learn more about the wizard. If you're looking for an overview of the wizard, see Import and
Export Data with the SQL Server Import and Export Wizard.
Learn about the steps in the wizard. If you're looking for info about the steps in the wizard, see
Steps in the SQL Server Import and Export Wizard. There's also a separate page of documentation for
each page of the wizard.
Learn how to connect to data sources and destinations. If you're looking for info about how to
connect to your data, select the page you want from the list here - Connect to data sources with the
SQL Server Import and Export Wizard. There's a separate page of documentation for each of several
commonly used data sources.
Start the wizard. If you're ready to run the wizard and just want to know how to start it, see Start the SQL
Server Import and Export Wizard.
Get the wizard. If you want to run the wizard, but you don't have Microsoft SQL Server installed on your
computer, you can install the SQL Server Import and Export Wizard by installing SQL Server Data Tools
(SSDT). For more info, see Download SQL Server Data Tools (SSDT).
Choose a Data Source (SQL Server Import and
Export Wizard)
11/20/2017 • 3 min to read • Edit Online

After the Welcome page, the SQL Server Import and Export Wizard shows Choose a Data Source. On this
page, you provide info about the source of your data and about how to connect to it.
For info about the data sources that you can use, see What data sources and destinations can I use?

Screen shot of the Choose a Data Source page


The following screen shot shows the first part of the Choose a Data Source page of the wizard. The rest of the
page has a variable number of options which depend on the data source that you choose here.

Choose a data source


Data source
Specify the data source by selecting a data provider that can connect to the source.
The data provider that you need is typically obvious from its name, because the name of the
provider typically contains the name of the data source - for example, Flat File Source, Microsoft Excel,
Microsoft Access, .Net Framework Data Provider for SqlServer, .Net Framework Data Provider for Oracle.
If you have an ODBC driver for your data source, select the .Net Framework Data Provider for ODBC.
Then enter the driver-specific info. ODBC drivers aren't listed in the drop-down list of data sources. The
.Net Framework Data Provider for ODBC acts as a wrapper around the ODBC driver. For more info, see
Connect to an ODBC Data Source.
There may be more than one provider available for your data source. Typically you can select any
provider that works with your source. For example, to connect to Microsoft SQL Server, you can use the
.NET Framework Data Provider for SQL Server or the SQL Server ODBC driver. (Other providers are also
still in the list but are no longer supported.)

My data source isn't in the list


You may have to download the data provider from Microsoft or from a third party. The list of
available data providers in the Data source list includes only the providers installed on your computer.
For info about the data sources that you can use, see What data sources and destinations can I use?
Do you have an ODBC driver for your data source? ODBC drivers aren't listed in the drop-down list
of data sources. If you have an ODBC driver for your data source, select the .Net Framework Data
Provider for ODBC. Then enter the driver-specific info. The .Net Framework Data Provider for ODBC acts
as a wrapper around the ODBC driver. For more info, see Connect to an ODBC Data Source.
64-bit and 32-bit providers. If you're running the 64-bit wizard, you won't see data sources for which
only a 32-bit provider is installed, and vice versa.

NOTE
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data
Tools (SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the
32-bit version of the wizard.

After you choose a data source


After you choose a data source, the rest of the Choose a Data Source page has a variable number of options
which depend on the data provider that you choose.
To connect to a commonly used data source, see one of the following pages.
Connect to SQL Server
Connect to Oracle
Connect to flat files (text files)
Connect to Excel
Connect to Access
Connect with ODBC
Connect to Azure Blob Storage
Connect to PostgreSQL
Connect to MySQL
For info about how to connect to a data source that's not listed here, see The Connection Strings Reference. This
third-party site contains sample connection strings and more info about data providers and the connection info
they require.

What's next?
After you provide info about the source of your data and about how to connect to it, the next page is Choose a
Destination. On this page, you provide info about the destination for your data and about how to connect to it.
For more info, see Choose a Destination.

See also
Get started with this simple example of the Import and Export Wizard
Choose a Destination (SQL Server Import and
Export Wizard)
11/20/2017 • 3 min to read • Edit Online

After you provide info about the source of your data and about how to connect to it, the SQL Server Import and
Export Wizard shows Choose a Destination. On this page, you provide info about the destination for your data
and about how to connect to it.
For info about the data destinations that you can use, see What data sources and destinations can I use?.

Screen shot of the Destination page


The following screen shot shows the first part of the Choose a Destination page of the wizard. The rest of the
page has a variable number of options which depend on the destination that you choose here.

Choose a destination
Destination
Specify the destination by selecting a data provider that can import data into the destination.
The data provider that you need is typically obvious from its name, because the name of the
provider typically contains the name of the destination - for example, Flat File Destination, Microsoft
Excel, Microsoft Access, .Net Framework Data Provider for SqlServer, .Net Framework Data Provider for
Oracle.
If you have an ODBC driver for your destination, select the .Net Framework Data Provider for ODBC.
Then enter the driver-specific info. ODBC drivers aren't listed in the drop-down list of destinations. The
.Net Framework Data Provider for ODBC acts as a wrapper around the ODBC driver. For more info, see
Connect to an ODBC Data Source.
There may be more than one provider available for your destination. Typically you can select any
provider that works with your destination. For example, to connect to Microsoft SQL Server, you can use
the .NET Framework Data Provider for SQL Server or the SQL Server ODBC driver. (Other providers are
also still in the list but are no longer supported.)

My destination isn't in the list


You may have to download the data provider from Microsoft or from a third party. The list of
available data providers in the Destination list includes only the providers installed on your computer.
For info about the destinations that you can use, see What data sources and destinations can I use?
Do you have an ODBC driver for your destination? ODBC drivers aren't listed in the drop-down list
of destinations. If you have an ODBC driver for your destination, select the .Net Framework Data Provider
for ODBC. Then enter the driver-specific info. The .Net Framework Data Provider for ODBC acts as a
wrapper around the ODBC driver. For more info, see Connect to an ODBC Data Source.
64-bit and 32-bit providers. If you're running the 64-bit wizard, you won't see destinations for which
only a 32-bit provider is installed, and vice versa.

NOTE
To use the 64-bit version of the SQL Server Import and Export Wizard, you have to install SQL Server. SQL Server Data
Tools (SSDT) and SQL Server Management Studio (SSMS) are 32-bit applications and only install 32-bit files, including the
32-bit version of the wizard.

After you choose a destination


After you choose a destination, the rest of the Choose a Destination page has a variable number of options
which depend on the data provider that you choose.
To connect to a commonly used destination, see one of the following pages.
Connect to SQL Server
Connect to Oracle
Connect to flat files (text files)
Connect to Excel
Connect to Access
Connect with ODBC
Connect to Azure Blob Storage
Connect to PostgreSQL
Connect to MySQL
For info about how to connect to a destination that's not listed here, see The Connection Strings Reference. This
third-party site contains sample connection strings and more info about data providers and the connection info
they require.

What's next?
After you provide info about the destination for your data and about how to connect to it, the next page is
Specify Table Copy or Query. On this page, you specify whether you want to copy an entire table or only
certain rows. For more info, see Specify Table Copy or Query.

See also
Get started with this simple example of the Import and Export Wizard
Create Database (SQL Server Import and Export
Wizard)
11/20/2017 • 2 min to read • Edit Online

If you select New on the Choose a Destination page to create a new SQL Server destination database, the SQL
Server Import and Export Wizard shows the Create Database dialog box. On this page, you provide a name for the
new database. Optionally you can also change the settings for the initial size and the automatic growth of the new
database and its log file.
The Create Database dialog box in the wizard offers only the basic options that are available for creating a new
SQL Server database. To see and configure all the options for a new SQL Server database, use SQL Server
Management Studio to create the database, or to configure the database after the wizard creates it.

NOTE
If you're looking for info about the Transact-SQL CREATE DATABASE statement, and not about the Create Database dialog
box of the SQL Server Import and Export Wizard, see CREATE DATABASE (SQL Server Transact-SQL).

Screen shot of the Create Database page


The following screen shot shows the Create Database dialog box of the wizard.

Provide a name for the new database


Name
Provide a name for the destination SQL Server database.
Naming requirements
Make sure that you follow SQL Server naming conventions when you name the database.
The database name must be unique within an instance of SQL Server.
The database name can be a maximum of 123 characters. (This allows 5 characters for the suffixes that SQL
Server appends to the data file and the log file, within the maximum of 128 characters.)
The database name must comply with the rules for identifiers in SQL Server. Here are the most important
requirements.
The first character must be a letter, underscore (_), at sign (@), or number sign (#).
Subsequent characters can be letters, numbers, the at sign, dollar sign ($), number sign, or
underscore.
You can't use spaces or other special characters.
For detailed info about these requirements, see Database Identifiers.

Optionally specify data file and log file options


TIP
You have to provide a name for the new database in the Name field, but typically you can leave the other settings for file
size and file growth at their default values.

Data file options


Initial size
Specify the number of megabytes for the initial size of the data file.
No growth allowed
Indicate whether the data file can grow beyond the specified initial size.
Grow by percentage
Specify a percentage by which the data file can grow.
Grow by size
Specify a number of megabytes by which the data file can grow.
Log file options
Initial size
Specify the number of megabytes for the initial size of the log file.
No growth allowed
Indicate whether the log file can grow beyond the specified initial size.
Grow by percentage
Specify a percentage by which the log file can grow.
Grow by size
Specify a number of megabytes by which the log file can grow.
More info
For more info about the file size options that you see on this page, see CREATE DATABASE (SQL Server Transact-
SQL).

What's next?
After you provide a name for the new database that the wizard will create and click OK, the Create Database
dialog box returns you to the Choose a Destination page. For more info, see Choose a Destination.
Specify Table Copy or Query (SQL Server Import
and Export Wizard)
11/20/2017 • 4 min to read • Edit Online

After you provide info about the destination for your data and about how to connect to it, the SQL Server Import
and Export Wizard shows Specify Table Copy or Query. On this page, you choose one of the following options.
Copy data from one or more tables or views. You want to pick a table or tables from a list.
Write a query to specify the data to transfer. You want to enter or paste in the text of a SQL query.

TIP
If you have to copy more than one database, or database objects other than tables and views, use the Copy Database
Wizard instead of the Import and Export Wizard. For more info, see Use the Copy Database Wizard.

Screen shot of the Specify Table Copy or Query page


The following screen shot shows the Specify Table Copy or Query page of the Wizard.

Specify whether to copy an entire table or write a query


Copy data from one or more tables or views
Select this option if you want to copy data from the source without filtering or sorting records.
When you select Copy data from one or more tables or views, you can copy from one table or view to one
destination table, or from multiple tables or views to multiple destination tables.
After you click Next, you select the tables to copy on the Select Source Tables and Views page. For more info,
see Select Source Tables and Views.
Write a query to specify the data to transfer
Select this option if you want to filter or sort the source data before you copy it to the destination.
When you select Write a query to specify the data to transfer, you can only copy the results of one query to
one destination table.
After you click Next, you provide a SQL statement to specify columns and select rows in the Provide a Source
Query dialog box. For more info, see Provide a Source Query.

Why isn't the Copy option available?


The Copy data from one or more tables or views option may not be available when the wizard uses a .NET
Framework data provider to connect to your data source. This happens when the wizard doesn't have enough info
about the data provider to request a list of tables and views from the data source.
You can still use the Write a query option, even if you don't typically write SQL queries, as long as you know the
name of the table that you want to export. In the Provide a Source Query dialog box, which you see after you
click Next, enter the query as SELECT * FROM <name of table> . If the name of the table contains spaces or other
special characters, surround the name with square brackets - SELECT * FROM [<name of table>] .
More info
The Copy data from one or more tables or views option is available only for those providers that have a
ProviderDescription section in the ProviderDescriptors.xml file. (By default, this file is in <drive>:\Program
Files\Microsoft SQL Server\130\DTS\ProviderDescriptors.) Each ProviderDescription section in this file contains
the information that's required to retrieve metadata from the corresponding provider.
By default, the ProviderDescriptors.xml file contains a ProviderDescription section only for the providers in the
following list.
.Net Framework Data Provider for SQL Server (System.Data.SqlClient)
.Net Framework Data Provider for Oracle (System.Data.OracleClient)
.Net Framework Data Provider for ODBC (System.Data.Odbc)
System.Data.OleDb (which applies to all OLE DB providers)
Microsoft Provider for DB2 installed by Microsoft Host Integration Server
(Microsoft.HostIntegration.MsDb2Client.MsDb2Connection)
Third-party developers can make the Copy data from one or more tables or views option available for
their provider by adding a ProviderDescriptor section to the ProviderDescriptors.xml file. To review the
requirements for the ProviderDescriptor section, see the ProviderDescriptors.xsd schema file which by
default is in the same folder as the ProviderDescriptors.xml file.

What's next?
After you specify whether you want to copy an entire table or provide a query, the next page depends on the
option that you chose on this page and also on the destination for your data.
If you selected Copy data from one or more tables or views, for most destinations the next page is
Select Source Tables and Views. On this page, you select the existing tables and views to copy from the
data source to the destination. For more info, see Select Source Tables and Views.
If you selected Copy data from one or more tables or views and your destination is a flat file, the next
page is Configure Flat File Destination. On this page, you specify formatting options for the destination
flat file. (Then, after you configure the flat file, the following page is Select Source Tables and Views.) For
more info, see Configure Flat File Destination.
If you selected Write a query to specify the data to transfer, the next page is Provide a Source Query.
On this page, you write and test the SQL statement that selects the data to copy from the data source to the
destination. (Then, after you provide a query, the following page is Select Source Tables and Views.) For
more info, see Provide a Source Query.

See also
Get started with this simple example of the Import and Export Wizard
Provide a Source Query (SQL Server Import and
Export Wizard)
11/20/2017 • 3 min to read • Edit Online

If you specified that you want to provide a query to select the data to copy, the SQL Server Import and Export
Wizard shows Provide a Source Query. On this page, you write and test the SQL query that selects the data to
copy from the data source to the destination. You can also paste the text of a saved query, or load the query text
from a file.

Screen shot of the Source Query page


The following screen shot shows the Provide a Source Query page of the Wizard.
In this simple example, the user has entered the query SELECT * FROM Sales.Customer to copy all rows and all
columns from the Sales.Customer table in the source database.
SELECT *means copy all columns.
The absence of a WHERE clause means copy all rows.

Provide the query and check its syntax


SQL statement
Type a SELECT query to retrieve specific rows and columns of data from the source database. You can also paste
the text of a saved query, or load the query from a file by clicking Browse.
For example, the following query retrieves the SalesPersonID, SalesQuota, and SalesYTD from the
AdventureWorks sample database for sales persons whose commission percentage is more than 1.5 percent.
SELECT SalesPersonID, SalesQuota, SalesYTD
FROM Sales.SalesPerson
WHERE CommissionPct > 0.015

For more examples of SELECT queries, see SELECT Examples (Transact-SQL) or search online.
If your data source is Excel, see Provide a source query for Excel later in this topic to learn how to specify Excel
worksheets and ranges in a query.
Parse
Check the syntax of the SQL statement that you entered in the SQL statement text box.

NOTE
If the time that's required to check the syntax of the statement exceeds the timeout value of 30 seconds, parsing stops and
raises an error. You won't be able to move past this page of the wizard until parsing succeeds. One solution to avoid a
timeout is to create a database view based on the query that you want to use, and then to query the view from the wizard,
instead of entering the query text directly.

Browse
Select a saved file that contains the text of a SQL query by using the Open dialog box. Selecting a file copies the
text from the file into the SQL statement text box.

Provide a source query for Excel


Specify Excel objects in queries
There are three types of Excel objects that you can query.
Worksheet. To query a worksheet, append the $ character to the end of the sheet name and add delimiters
around the string - for example, [Sheet1$].

SELECT * FROM [Sheet1$]

Named range. To query a named range, simply use the range name - for example, MyDataRange.

SELECT * FROM MyDataRange

Unnamed range. To specify a range of cells that you haven't named, append the $ character to the end of
the sheet name, add the range specification, and add delimiters around the string - for example,
[Sheet1$A1:B4].

SELECT * FROM [Sheet1$A1:B4]

Prepare the Excel source data


Whether you specify a worksheet or a range as the source table, the driver reads the contiguous block of cells
starting with the first non-empty cell in the upper-left corner of the worksheet or range. As a result, you can't have
empty rows in the source data. For example, you can't have an empty row between the column headers and the
data rows. If you have a title followed by empty rows at the top of the worksheet above your data, you can't query
the worksheet. In Excel, you have to assign a name to your range of data, and query the named range instead of
the worksheet.
What's next?
After you write and test the SQL query that selects the data to copy, the next page depends on the destination for
your data.
For most destinations the next page is Select Source Tables and Views. On this page, you review the
query that you provided and optionally choose columns to copy and preview sample data. For more info,
see Select Source Tables and Views.
If your destination is a flat file, the next page is Configure Flat File Destination. On this page, you specify
formatting options for the destination flat file. (After you configure the flat file, the next page is then Select
Source Tables and Views.) For more info, see Configure Flat File Destination.
Select Source Tables and Views (SQL Server Import
and Export Wizard)
11/20/2017 • 8 min to read • Edit Online

After you specify that you want to copy an entire table, or after you provide a query, the SQL Server Import and
Export Wizard shows Select Source Tables and Views. On this page, you select the existing tables and views
that you want to copy. Then you map the source tables to new or existing destination tables. Optionally, you also
review the mapping of individual columns and preview sample data.

TIP
If you have to copy more than one SQL Server database, or SQL Server database objects other than tables and views, use
the Copy Database Wizard instead of the Import and Export Wizard. For more info, see Use the Copy Database Wizard.

Screen shot - If you're going to copy tables


The following screen shot shows an example of the Select Source Tables and Views page of the wizard when
you previously selected the Copy data from one or more tables or views option on the Specify Table Copy
or Query page. In the list you see all the tables and views available from the data source.
In this example, the Source list contains all the tables in the AdventureWorks sample database. The selected row
shows that the user wants to copy the Sales.Customer table from the source to the new Sales.CustomerNew
table at the destination.

Screen shot - If you provided a query


The following screen shot shows an example of the Select Source Tables and Views page of the wizard when
you previously selected the Write a query to specify the data to transfer option on the Specify Table Copy
or Query page. The Source list contains only a single row, where the item named [Query] represents the query
that you provided on the Provide a Source Query page.
In this example, the user wants to copy the query results from the source to the Sales.CustomerNew table at the
destination.

Select source and destination tables


Source
Using the check boxes, select from the list of available tables and views to copy to the destination. By default, data
from the data source is copied without changes. If you create a new destination table, the schema for the new
table - that is, the list of columns and their properties - is also copied without change from the data source.
If you provided a query, the list contains only one item with the name [Query] .
Destination
Select a destination table from the list for each source table or query, or enter the name of a new table that you
want the wizard to create. If you select an existing destination table, the table has to have columns with data types
that are compatible with the source data.

NOTE
If you pause at this point in the wizard to create a new table manually in the destination database by using an external tool
(such as SQL Server Management Studio), the new table is not immediately visible in the list of available destination tables.
To refresh the list of destination tables, step back to the Choose a Destination page, re-select the destination database to
refresh the list of available tables and views, and then step forward again to the Select Source Tables and Views page.

Optionally, review column mappings and preview data


Edit mappings
Optionally, click Edit mappings to display the Column Mappings dialog box for the selected table. Use the
Column Mappings dialog box to do the following things,
Review the mapping of individual columns between the source and the destination.
Copy only a subset of columns by selecting ignore for columns that you don't want to copy.
For more info, see Column Mappings.
Preview
Optionally, click Preview to preview up to 200 rows of sample data in the Preview Data dialog box. This
confirms that the wizard is going to copy the data that you want to copy. For more info, see Preview Data.
After you preview the data, you may want to change the options that you selected on previous pages of the
wizard. To make these changes, return to the Select Source Tables and Views page, and then click Back to
return to previous pages where you can change your selections.

Select source and destination tables for Excel


Excel source tables
The list of source tables and views for an Excel data source includes two types of Excel objects.
Worksheets. Worksheet names are followed by the dollar sign ($) - for example, 'Sheet1$'.
Named ranges. Named ranges, if any, are listed by name.
If you want to load data from or to a specific, unnamed range of cells - for example, from or to [Sheet1$A1:B4],
you have to write a query. Step back to the Specify Table Copy or Query page and select Write a query to
specify the data to transfer.
Prepare the Excel source data
Whether you specify a worksheet or a range as the source table, the driver reads the contiguous block of cells
starting with the first non-empty cell in the upper-left corner of the worksheet or range. As a result, you can't
have empty rows in the source data. For example, you can't have an empty row between the column headers and
the data rows. If you have a title followed by empty rows at the top of the worksheet above your data, you can't
query the worksheet. In Excel, you have to assign a name to your range of data, and query the named range
instead of the worksheet.
Excel destination tables
If you are exporting data to Excel, you can specify the destination in one of the following three ways.
Worksheet. To specify a worksheet, append the $ character to the end of the sheet name and add delimiters
around the string - for example, [Sheet1$].
Named range. To specify a named range, simply use the range name - for example, MyDataRange.
Unnamed range. To specify a range of cells that you haven't named, append the $ character to the end of the
sheet name, add the range specification, and add delimiters around the string - for example, [Sheet1$A1:B4].

Special considerations for Excel sources and destinations


When you're using Excel as a source or destination, it's a good idea to click Edit Mappings and to review the
data type mappings on the Column Mappings page.
Data types in Excel workbooks. Excel is not a typical database. Its columns do not have fixed data types. The
wizard recognizes only a limited set of data types in Excel - numeric, currency, Boolean, date/time, string (255
characters or less), and memo (more than 255 characters). The wizard samples a certain number of rows (by
default, the first eight rows) in an existing Excel data source to guess at the data type of each column.
When the wizard has to do explicit data type conversions to load from or to Excel, it typically displays the Review
Data Type Mapping page where you can review those conversions. These conversions may include the
following.
Conversion between double-precision Excel numeric columns and numeric columns of other types.
Conversion between 255-character Excel string columns and string columns of different lengths.
Conversion between Unicode Excel string columns and non-Unicode string columns that use specific
codepages.
Special considerations for Excel sources
Null or missing values in imported data. When an Excel column appears to contain mixed data types in the
first eight rows sampled by the wizard - for example, numeric values mixed with text values - the wizard picks the
majority data type as the data type of the column, and returns null values for cells that contain data of other
types. There is no way to change this behavior of the wizard.
Truncated strings in imported data. When the wizard determines that an Excel column contains text data, the
wizard picks the data type of the column - string or memo - based on the longest value that it samples in the first
eight rows. If the wizard doesn't find any values longer than 255 characters in the rows that it samples, it treats
the column as a 255-character string column instead of a memo column, and truncates values longer than 255
characters. To import data from a memo column without truncation, you have to make sure that the memo
column contains at least one value longer than 255 characters in the first eight rows that are sampled by the
wizard.
Special considerations for Excel destinations
Specifying an existing range. When you specify an existing range as the destination, you get an error if the
range has fewer columns than the source data. However, if the range that you specify has fewer rows than the
source data, the wizard continues writing rows and extends the range definition to match the new number of
rows.
Saving memo (ntext) data. Before you can successfully save strings longer than 255 characters to an Excel
column, the wizard has to recognize the data type of the destination column as memo and not string.
If the destination table already contains rows of data, the first eight rows that are sampled by the wizard have
to contain at least one row with a value longer than 255 characters in the memo column.
If the destination table is created by the wizard, the CREATE TABLE statement must use LONGTEXT (or one of
its synonyms) as the data type of the the memo column. Check the CREATE TABLE statement and revise it, if
necessary, by clicking Edit SQL next to the Create destination table option on the Column Mappings page.

What's next?
After you select the existing tables and views to copy and map them to their destinations, the next page is Save
and Run Package. On this page, you specify whether you want to run the copy operation immediately.
Depending on your configuration, you may also be able to save the SQL Server Integration Services package
created by the wizard to customize it and to reuse it later. For more info, see Save and Run Package.

See also
Get started with this simple example of the Import and Export Wizard
Configure Flat File Destination (SQL Server Import
and Export Wizard)
11/20/2017 • 2 min to read • Edit Online

If you selected a flat file destination, the SQL Server Import and Export Wizard shows Configure Flat File
Destination after you specify that you want to copy a table or after you provide a query. On this page, you specify
formatting options for the destination flat file. Optionally, you review the mapping of individual columns and
preview sample data.

Screen shot of the Configure Flat File Destination page


The following screen shot shows an example of the Configure Flat File Destination page of the wizard.
In this example, the user has specified the following options to create a typical CSV (comma-separated values) file.
Row delimiter. Each row of data in the output ends with a carriage return-line feed combination.
Column delimiter. Columns of data within each row are separated with a comma.

Pick a source table


Source table or view
If you specified on a previous page that you want to copy a table, select the source table or view from the drop-
down list.
If you provided a query, "Query" is selected and is the only option.

Specify row and column delimiters for the output


Row delimiter
Select from the list of delimiters to separate rows in the output. There is no option to specify a custom row
delimiter.

VALUE DESCRIPTION

{CR}{LF} Delimit rows with a carriage return-line feed combination.

{CR} Delimit rows with a carriage return.

{LF} Delimit rows with a line feed.

Semicolon {;} Delimit rows with a semicolon.

Colon {:} Delimit rows with a colon.

Comma {,} Delimit rows with a comma.

Tab {t} Delimit rows with a tab.

Vertical bar {|} Delimit rows with a vertical bar.

Column delimiter
Select from the list of delimiters to separate columns in the output. There is no option to specify a custom column
delimiter.

VALUE DESCRIPTION

{CR}{LF} Delimit columns with a carriage return-line feed combination.

{CR} Delimit columns with a carriage return.

{LF} Delimit columns with a line feed.

Semicolon {;} Delimit columns with a semicolon.

Colon {:} Delimit columns with a colon.

Comma {,} Delimit columns with a comma.

Tab {t} Delimit columns with a tab.

Vertical bar {|} Delimit columns with a vertical bar.

Optionally, review column mappings and preview data


Edit mappings
Optionally, click Edit mappings to display the Column Mappings dialog box for the selected table. Use the
Column Mappings dialog box to do the following things.
Review the mapping of individual columns between the source and the destination.
Copy only a subset of columns by selecting ignore for columns that you don't want to copy.
For more info, see Column Mappings.
Preview
Optionally, click Preview to preview up to 200 rows of sample data in the Preview Data dialog box. This confirms
that the wizard is going to copy the data that you want to copy. For more info, see Preview Data.
After you preview the data, you may want to change the options that you selected on previous pages of the
wizard. To make these changes, return to the Configure Flat File Destination page, and then click Back to return
to previous pages where you can change your selections.

What's next?
After you specify formatting options for the destination flat file, the next page is Save and Execute Package. On
this page, you specify whether you want to run the operation immediately. Depending on your configuration, you
may also be able to save your settings as a SQL Server Integration Services package to customize it and to reuse it
later. For more info, see Save and Run Package.
Convert Types without Conversion Checking (SQL
Server Import and Export Wizard)
11/20/2017 • 1 min to read • Edit Online

After you select the existing tables and views to copy or review the query that you provided, the SQL Server Import
and Export Wizard may show Convert Types without Conversion Checking. The wizard shows this page when it
can't locate one or more of the data type conversion and mapping files that it needs to map data types between
your source and destination. The page includes information that helps you to understand what's missing.
Click Next to continue without knowing whether data type conversions will succeed. Otherwise, click Back to
change your selections, or click Cancel to exit the wizard.

Screen shot of the Convert Types page


The following screen shot shows an example of the Convert Types without Conversion Checking page of the
Wizard.

The problem here is that the wizard can't find a mapping file that maps data types for the destination you selected.
The info on this page doesn't include the name of the missing mapping file. Since the wizard doesn't know whether
a file exists for the specified data provider, it can't provide a name for the missing file.

What's next?
After you click Next to continue without knowing whether data type conversions will succeed, the next page is
Save and Run Package. On this page, you specify whether you want to run the copy operation immediately.
Depending on your configuration, you may also be able to save the SQL Server Integration Services package
created by the wizard to customize it and to reuse it later. For more info, see Save and Run Package.

See also
Data Type Mapping in the SQL Server Import and Export Wizard
Column Mappings (SQL Server Import and Export
Wizard)
11/20/2017 • 4 min to read • Edit Online

After you select the existing tables and views to copy or review the query that you provided, if you click Edit
mappings, the SQL Server Import and Export Wizard shows the Column Mappings dialog box. On this page
you specify and configure destination columns to receive the data copied from the source columns. Often you
don't have to change anything on this page.
If you don't want to copy all the columns in the table you selected, one thing you can do on this page is exclude
the columns you don't want. Select ignore in the Destination column of the Mappings list for columns that you
don't want to copy.

Screen shot of the Column Mappings page


The following screen shot shows an example of the Column Mappings dialog box of the wizard.
In this example, you see that the wizard is going to create a new destination table, because Create destination
table is selected. By default, the wizard gives each column in the new destination table the same name, data type,
and properties as the corresponding source column.

Review the source and destination


Source
The selected source table, view, or query.
Destination
The selected destination table or view.

Optionally, create a new destination table

Create destination table/file


Create the destination table if it does not already exist.
Edit SQL
Click Edit SQL to open the Create Table SQL Statement dialog box. Use the autogenerated CREATE TABLE
statement, or modify it for your purposes. If you change this statement manually, you have to make sure that the
list of column mappings recognizes your changes. For more info, see Create Table SQL Statement.
Sometimes these options are disabled
The Create destination table/file option and the Edit SQL button are either automatically enabled or
automatically disabled.
Enabled. If you specified a new destination table on the Select Source Tables and Views page, the
Create destination table option is automatically selected and the Edit SQL button is enabled.
Disabled. If you selected an existing destination table on the Select Source Tables and Views page, the
Create destination table option and the Edit SQL button are disabled. If you want to create a new
destination table, go back to the Select Source Tables and Views page and enter the name of a new
table in the Destination column.

What about existing data in the destination?

Delete rows in destination table/file


Specify whether to clear the data from an existing table before loading the new data.
Append rows to destination table/file
Specify whether to append the new data to the data already present in an existing table.
Drop and re-create destination table
Choose this option to overwrite the destination table. This option is only available when you used the wizard to
create the destination table. The destination table is only dropped and re-created if you save the package that the
wizard creates and then run the package again. This is a convenient option when you want to test your settings
more than once.
Enable identity insert
Choose this option to allow existing identity values in the source data to be inserted into an identity column in the
destination table. By default, the destination identity column typically does not allow this.

TIP
If your existing primary keys are in an identity column, an autonumber column, or the equivalent, you typically have to
select this option to keep your existing primary key values. Otherwise the destination identity column typically assigns new
values.

Keep your autonumber or identity values


If you're exporting data that has an autonumber column or an identity column - for example, if you're exporting
from Microsoft Access - make sure you select Enable identity insert as described immediately above.
Review column mappings

Mappings
Displays how each column in the data source maps to a column in the destination.
The Mappings list has the following columns.
Source
View each source column.
Destination
View the mapped destination column or select a different column.
You don't have to copy all the columns from the source table. Select ignore in this column for columns
that you want to skip. Before you map columns, you must ignore all columns that will not be mapped.
Type
View the data type for the destination column or select a different data type.
Nullable
Specify whether the destination column allows a null value.
Size
Specify the number of characters in the destination column, if applicable.
Precision
Specify the precision of numeric data in the destination column - that is, the number of digits - if
applicable.
Scale
Specify the scale of numeric data in the destination column - that is, the number of decimal places - if
applicable.

What's next?
After you review and configure destination columns to receive the data copied from the source columns and click
OK, the Column Mappings dialog box returns you to the Select Source Tables and Views page or to the
Configure Flat File Destination page. For more info, see Select Source Tables and Views or Configure Flat File
Destination.
If you specified a mapping that may not succeed in the Mappings list, then the Column Mappings dialog box
takes you to the Review Data Type Mapping page. On this page, you review the warnings, specify conversion
options, and also specify how to handle errors. For more info, see Review Data Type Mapping.

See also
Data Type Mapping in the SQL Server Import and Export Wizard
Get started with this simple example of the Import and Export Wizard
Review Data Type Mapping (SQL Server Import and
Export Wizard)
11/20/2017 • 5 min to read • Edit Online

If you specified a data type mapping that may not succeed in the Mappings list of the Column Mappings dialog
box, the SQL Server Import and Export Wizard shows the Review Data Type Mapping page. On this page, you
review detailed information about data type conversions that the wizard has to perform to make the source data
compatible with the destination. This information includes visual cues to distinguish data type conversions that are
expected to succeed from conversions that may cause errors or truncations. For each conversion, you decide
whether to accept the conversion that the wizard suggests, and you specify how to handle any errors that may
occur.

TIP
You can't change data type mappings on the Review Data Type Mapping page. However, you can click Back to return to
the Select Source Tables and Views page, and then click Edit Mappings to open the Column Mappings dialog box
again. In the Column Mappings dialog box, you can specify data type mappings that are more likely to succeed. To take
another look at the Column Mappings dialog box, see Column Mappings.

Screen shot of the Review Data Type Mapping page


The following screen shot shows an example of the Review Data Type Mapping page of the wizard.
In this example:
The user has specified a mapping in the Column Mappings dialog box that may not succeed.
The warning icon on the row in the Table list indicates that there is a problem converting at least one column
of data from the query results to a compatible data type in the destination table.
The warning icon on the first row in the Data type mapping list indicates that the mapping from the int
data type of the source column to the smalldatetime data type of the destination column may cause a loss
of data.
Review the source and destination tables
The upper section of the Review Data Type Mapping page is a Table list that lists the tables to be copied from
the source to the destination. To see conversion information about an individual table, select a table in the Table
list. The conversion information for the individual columns of the selected table appears in the lower part of the
page in the Data type mapping grid.
In this example, the results of the query that the user provided will be copied to the Sales.CustomerNew2 table at
the destination. The warning icon indicates that there is a problem converting at least one column of data from the
query results to a compatible data type in the destination table.

The following table describes the columns in the Table list.

COLUMN DESCRIPTION

(Source icon) Indicates the probability of success for the data type
conversions:
- A green check mark icon indicates that the wizard expects
all data type conversions for this table to succeed.
- A yellow warning icon indicates that you should review the
individual conversions that the wizard will perform. To review
these conversions, select the table, and then review the
conversions for individual columns in the Data type
mapping list.
- A red error icon indicates that the wizard is not able to
perform some of the conversions for this table reliably.

Source The name of the source table.


COLUMN DESCRIPTION

(Destination icon) Indicates whether the destination already exists or will be


created by the wizard:
- A table icon indicates that the destination is an existing
table.
- A table icon with a sunburst indicates that the destination is
a new table that the wizard will create.

Destination The name of the destination table.

Review the data type mappings


The middle section of the Review Data Type Mapping page is the Data type mapping list. This grid provides
detailed conversion information about the columns in the source table that's selected in the Table list in the upper
part of the page.
In this example, each column at the source will be copied to a column with the same name and data type at the
destination. The warning icon on the first row in the Data type mapping list indicates that the mapping from the
int data type of the source column to the smalldatetime data type of the destination column may cause a loss of
data.

The following table describes the columns in the Data type mapping list.

COLUMN DESCRIPTION

(Conversion icon) Indicates the probability of success for the data type
conversions:
- A green check mark icon indicates that the wizard expects
the data type conversion for this column to succeed.
- A yellow warning icon indicates that you should review the
conversion that the wizard will perform. To review the
conversion, double-click on the column to view the Column
Conversion Details dialog box. For more info, see Column
Conversion Details Dialog Box.
- A red error icon indicates that the wizard is not able to
perform the conversion reliably.

Source Column The name of the source column.

Source Type The data type of the source column.

Destination Column The name of the destination column.

Destination Type The data type of the destination column.


COLUMN DESCRIPTION

Convert Specify whether to continue with the planned conversion:


- Select the check box to have the wizard continue with the
planned conversion.
- Clear the check box to cancel the data type conversion.

On Error Specify how the wizard handles errors:


- Use the On Error (global) setting, which you can specify at
the bottom of this page.
- Fail with an error, and stop the import or export process.
- Ignore the error.

On Truncation Specify how the wizard handles truncation:


- Use the On Truncation (global) setting, which you can
specify at the bottom of this page.
- Fail with an error, and stop the import or export process
- Ignore the truncation.

TIP
To see detailed information about the conversion of a particular column of data, double-click any row in the list. The Column
Conversion Details dialog box opens and displays more detailed conversion information for the column. For more info, see
Column Conversion Details Dialog Box.

Specify global error handling options


The lower section of the Review Data Type Mapping page lets you specify error handling options that apply by
default to all columns. These settings apply to all conversions that have Use Global selected in the On Error or On
Truncation columns of the Data type mapping list.
This example shows the default values for the two global error handling options.

On Error (global)
Specify how the wizard handles errors:
Fail with an error, and stop the import or export process. This is the default value.
Ignore the error, and continue the import or export process.
On Truncation (global)
Specify how the wizard handles data truncation:
Fail with an error, and stop the import or export process. This is the default value.
Ignore the truncation, and continue the import or export process.

What's next?
After you review the warnings, specify conversion options, and specify how to handle errors, the Review Data
Type Mapping page takes you back to the Column Mappings dialog box. For more info, see Column Mappings.

See also
Data Type Mapping in the SQL Server Import and Export Wizard
Column Conversion Details Dialog Box (SQL Server
Import and Export Wizard)
11/20/2017 • 1 min to read • Edit Online

If you double-click the row for an individual column on the Review Data Type Mapping page, the SQL Server
Import and Export Wizard shows the Column Conversion Details dialog box. On this page you can review
detailed conversion information for an individual column. This information includes the following items.
The data type of the column at the source and the destination.
The data type conversion that the wizard will perform, if a conversion is required.
The data type mapping files that the wizard uses to determine the required data type conversion.

Screen shot of the Column Conversion Details page


The following screen shot shows the Column Conversion Details dialog box of the Wizard after the user has
double-clicked on a row on the Review Data Type Mapping page. To take another look at the Review Data
Type Mapping page, see Review Data Type Mapping.
In this example, you see the following things.
The PersonID column in the source SQL Server table is of type int . The wizard maps this type to the SQL
Server Integration Services (SSIS) DT_I4 data type, which is a four-byte signed integer, by referring to the data
type mapping file MSSQLToSSIS10.xml.
The PersonID column in the destination SQL Server table is also of type int . The wizard maps this type to the
the same SSIS data type.
The wizard concludes, This column does not need conversion.

What's next?
After you review the column conversion details and click OK, the Column Conversion Details dialog box returns
you to the Review Data Type Mapping page. For more info, see Review Data Type Mapping.
See also
Data Type Mapping in the SQL Server Import and Export Wizard
Create Table SQL Statement (SQL Server Import and
Export Wizard)
11/20/2017 • 2 min to read • Edit Online

If you select Create destination table and then select Edit SQL in the Column Mappings dialog box, the SQL
Server Import and Export Wizard shows the Create Table SQL Statement dialog box. On this page, you review
and optionally customize the CREATE TABLE command that the wizard will run to create the new destination
table.

NOTE
If you're looking for info about the Transact-SQL CREATE TABLE statement, and not about the Create Table SQL
Statement dialog box of the SQL Server Import and Export Wizard, see CREATE TABLE (Transact-SQL).

Screen shot of the Create Table SQL Statement page


The following screen shot shows the Create Table SQL Statement dialog box of the Wizard.
In this example, the SQL statement box contains the default CREATE TABLE statement generated by the wizard.
This statement creates a new destination table named Person.AddressNew that's a copy of the Person.Address
source table.

Review or regenerate the CREATE TABLE statement


SQL statement
Displays the auto-generated SQL statement and lets you customize it.
If you change the default CREATE TABLE command, you may also have to make changes to the associated column
mappings when you return to the Column Mappings dialog box.
To include a carriage return in the text of the SQL statement, press CTRL+ENTER. If you press ENTER alone, the
dialog box closes.
For more info about the CREATE TABLE statement and syntax, see CREATE TABLE (Transact-SQL).
Autogenerate
Restore the default SQL statement, if you've changed it, by clicking Auto Generate.
Create a table that includes a FILESTREAM column
The SQL Server Import and Export Wizard generates a default CREATE TABLE statement based on the connected
data source. This default CREATE TABLE statement does not include the FILESTREAM attribute even if the source
table has a FILESTREAM column.
1. To copy a FILESTREAM column by using the wizard, first implement FILESTREAM storage on the destination
database.
2. Then, add the FILESTREAM attribute manually to the CREATE TABLE statement in the Create Table SQL
Statement dialog box.
For more info about the syntax, see CREATE TABLE (Transact-SQL). For more info about FILESTREAM, see Binary
Large Object (Blob) Data (SQL Server).

What's next?
After you review and customize the CREATE TABLE command and click OK, the Create Table SQL Statement
dialog box returns you to the Column Mappings dialog box. For more info, see Column Mappings.

See also
Get started with this simple example of the Import and Export Wizard
Preview Data Dialog Box (SQL Server Import and
Export Wizard)
11/20/2017 • 1 min to read • Edit Online

After you specify the data that you want to copy, you can optionally click Preview to open the Preview Data
dialog box. On this page, you can preview up to 200 rows of sample data from your data source. This confirms
that the wizard is going to copy the data that you want to copy.

Screen shot of the Preview Data page


The following screen shot shows the Preview Data dialog box of the Wizard.

Preview sample data


Source
Displays the query that the wizard is using to load data from the data source.
If you selected a table to copy, the Source field displays a SELECT * FROM <table> query instead of the table name.
Sample data grid
Displays up to 200 rows of sample data that the query returns from the data source.

That's not right, I want to change something


After you preview the data, you may want to change the options that you selected on previous pages of the
wizard. To make these changes, click OK to return to the Select Source Tables and Views page, and then click
Back to return to previous pages where you can change your selections.

What's next?
After you preview the data that you're going to copy and click OK, the Preview Data dialog box returns you to
the Select Source Tables and Views page or the Configure Flat File Destination page. For more info, see
Select Source Tables and Views or Configure Flat File Destination.

See also
Get started with this simple example of the Import and Export Wizard
Save and Run Package (SQL Server Import and
Export Wizard)
11/20/2017 • 3 min to read • Edit Online

After you specify and configure your data source and destination, the SQL Server Import and Export Wizard
shows Save and Run Package. On this page, you specify whether you want to run the copy operation
immediately. Depending on your configuration, you may also be able to save your settings as a SQL Server
Integration Services (SSIS) package to customize it and to reuse it later.
What's a package? The Wizard uses SQL Server Integration Services (SSIS) to copy data. In SSIS, the basic unit is
the package. The wizard creates an SSIS package in memory as you move through the pages of the wizard and
specify options.

Screen shot of the Save and Run Package page


The following screen shot shows the Save and Run Package page of the wizard.

Run and save the package


To continue, you have to select at least one of the following two options.
Run immediately
Select this option to import and export data immediately. By default, this check box is selected and the operation
runs immediately.
Save SSIS Package
Save your settings as an SSIS package. Later you can optionally customize the package and run it again. If you
choose to save the package, there are additional options on the next page, Save SSIS Package.
The option to save the package is available only if you have SQL Server Standard Edition or a higher edition
installed.
NOTE
If you finish the wizard, run the operation, but stop the operation before it finishes running, the package is not saved, even
if you selected the Save SSIS Package check box.

If you started the wizard from Visual Studio


If you started the wizard from an Integration Services project in Visual Studio with SQL Server Data Tools (SSDT):
You can't run the package until after you exit the wizard. Then you can run the package from Visual Studio.
The wizard saves the package in the Integration Services project from which you started the wizard.

Specify options for saving the package


SQL Server
Select this option to save the package in SQL Server in the msdb database in the sysssispackages table.

IMPORTANT
This option does not save the package to the SSIS Catalog database (SSISDB).

You select the target server and provide credentials to connect to the server on the next page, Save SSIS
Package. For more info, see Save SSIS Package.
File system
Select this option to save the package as a file with the .dtsx extension.
You select the target folder and file name for the package on the next page, Save SSIS Package. For more info,
see Save SSIS Package.

Specify the package protection level


Package protection level
Select a protection level from the list to help protect the data in the package.
The protection level determines the protection method, the password or user key, and the scope of package
protection. Protection can include all data or sensitive data only. For more info about the available options, see
Access Control for Sensitive Data in Packages.
Password
Type a password.
Retype password
Type the password again.

NOTE
The password options are available only if specify a Package protection level that requires a password - that is, if you
specify either Encrypt sensitive data with password or Encrypt all data with password.

About the two pages of options for saving the package


The Save and Run Package page is one of two pages on which you pick options for saving the SSIS package.
On the current page, you pick whether to save the package in SQL Server or as a file. You also pick security
settings for the saved package.
Next, on the Save SSIS Package page, you provide a name for the package and more info about where to
save it. For more info, see Save SSIS Package.
These options are available only if you select the Save SSIS Package option on this page.

What's next?
After you specify whether to run the copy operation immediately and whether to save the package, the next page
depends on the options that you choose.
If you selected the option to run the package immediately, but not to save it, the next page is Complete
the Wizard. On this page, you review the choices that you made in the wizard, and then start the copy
operation. For more info, see Complete the Wizard.
If you selected the option to save the package, the next page is Save SSIS Package. On this page, you
specify additional options for saving the package. (Then, after you save the package, the following page is
Complete the Wizard.) For more info, see Save SSIS Package.

See Also
Save Packages
Run Integration Services (SSIS) Packages
SQL Server Integration Services
Get started with this simple example of the Import and Export Wizard
Save SSIS Package (SQL Server Import and Export
Wizard)
11/20/2017 • 4 min to read • Edit Online

If you specified on the Save and Run Package page that you want to save your settings as a SQL Server
Integration Services (SSIS) package, the SQL Server Import and Export Wizard shows Save SSIS Package. On this
page, you specify additional options for saving the package created by the wizard.
The options that you see on the Save SSIS Package page depend on the choice that you made previously on the
Save and Run Package page to save the package to SQL Server or to the file system. To take another look at the
Save and Run Package page, see Save and Run Package.
What's a package? The Wizard uses SQL Server Integration Services (SSIS) to copy data. In SSIS, the basic unit is
the package. The wizard creates an SSIS package in memory as you move through the pages of the wizard and
specify options.

Screen shot - Common options


The following screen shot shows the first part of the Save SSIS Package page of the wizard. The rest of the page
has a variable number of options which depend on the package destination that you chose.

Provide a name and description for the package


Name
Provide a unique name for the package.
Description
Provide a description for the package. As a best practice, describe the purpose of the package, to make packages
self-documenting and easier to maintain.
Target
The destination ( SQL Server or File system) that you previously specified for the package. If you want to save the
package to a different destination, go back to the Save and Run Package page.

Screen shot - Save the package in SQL Server


The following screen shot shows the Save SSIS Package page of the wizard if you selected the SQL Server
option on the Save and Run Package page.
Options to specify (Target = SQL Server)
NOTE
The wizard saves the package in the msdb database in the sysssispackages table. This option does not save the package
to the SSIS Catalog database (SSISDB).

Server name
Type or select the destination server name.
Use Windows Authentication
Connect to the server by using Windows Integrated Authentication. This is the preferred authentication method.
Use SQL Server Authentication
Connect to the server by using SQL Server Authentication.
User name
If you specified SQL Server Authentication, enter the user name.
Password
If you specified SQL Server Authentication, enter the password.

Screen shot - Save the package in the file system


The following screen shot shows the Save SSIS Package page of the wizard if you selected the File system
option on the Save and Run Package page.
Options to specify (Target = File system)
File name
Enter the path and filename for the destination file, or use the Browse button to select a destination.

TIP
Be sure to specify a destination folder, either by entering it or by browsing. If you only enter the filename without a path,
you don't know where the wizard saves the package. Also, the wizard may try to save the package to a location where you
don't have permission to save a file, and raise an error.
Remember where you save the package file.

Browse
Optionally, browse to select the path for the destination file in the Save Package dialog box.

About the two pages of options for saving the package


The Save SSIS Package page is one of two pages on which you pick options for saving the SSIS package.
On the previous page, Save and Execute Package, you pick whether to save the package in SQL Server
or as a file. You also pick security settings for the saved package. To take another look at the Save and Run
Package page, see Save and Run Package.
On the current page, you provide a name for the package and more info about where to save it.

Run the saved package again later


To learn how to run the saved package again later, see one the following topics.
To run a package by using a utility program with a friendly user interface, see Execute Package Utility
(DtExecUI) UI Reference.
To run a package from the command line or from a batch file, see dtexec Utility.
If you saved the package in SQL Server in the msdb database, connect to the Integration Services service.
Then, in SQL Server Management Studio, in Object Explorer, navigate to Stored Packages | MSDB, right-
click on the package, and select Run Package.
If you saved the package in the file system, see Run Integration Services (SSIS) Packages to run the package
in the development environment. You have to add the package to an Integration Services project before
you can open and run it.

Customize the saved package


To learn how to customize the saved package, see Integration Services (SSIS) Packages.

What's next?
After you specify additional options for saving the package, the next page is Complete the Wizard. On this page,
you review the choices that you made in the wizard, and then you start the operation. For more info, see Complete
the Wizard.

See Also
Save Packages
Run Integration Services (SSIS) Packages
SQL Server Integration Services
Complete the Wizard (SQL Server Import and
Export Wizard)
11/20/2017 • 1 min to read • Edit Online

After you specify whether you want to run the copy operation immediately, and after you optionally save the
package that the wizard created, the SQL Server Import and Export Wizard shows Complete the Wizard. On this
page, you review the choices that you made in the wizard, and then click Finish to start the copy operation.

Screen shot of the Complete the Wizard page


The following screen shot shows a simple example of the Complete the Wizard page of the wizard.

Review the options you selected


Review the summary and verify the following information:
The source and destination of the data to copy.
The data to copy.
Whether the package will be saved.
Whether the package will be run immediately.

What's next?
After you review the choices that you made in the wizard and click Finish, the next page is Performing
Operation. On this page, you see the progress and the result of the operation that you configured on the
preceding pages. For more info, see Performing Operation.

See also
Get started with this simple example of the Import and Export Wizard
Performing Operation (SQL Server Import and
Export Wizard)
11/20/2017 • 1 min to read • Edit Online

After you review the choices that you made in the wizard and click Finish on the Complete the Wizard page, the
SQL Server Import and Export Wizard shows Performing Operation. On this page, you see the progress and the
result of the operation that you configured on the preceding pages. You don't have to take any action on this page.

Screen shot - Operation in progress


The following screen shot shows the Performing Operation page of the wizard while the operation is still in
progress.

Screen shot - Operation completed


The following screen shot shows the Performing Operation page of the wizard after the operation is complete.
Click on an item in the Message column to get more info about the corresponding step.
Watch the progress of the operation
Action
Displays each step of the operation.
Status
Displays the success or failure of each step.
Message
Displays informational and error messages about the step. Click on an item in this column to get more info about
the corresponding step.

Interrupt the operation or save the results


Stop
Interrupt the operation, if necessary, by clicking the Stop button.
Report
View a report of the results, save the report to a file, copy the report to the clipboard, or send the report by e-mail.

What's next?
After the operation that you configured runs and completes successfully, you're finished running the SQL Server
Import and Export Wizard.
If you ran the operation immediately, you can open the destination that you selected to review the data that the
wizard copied.
If you saved the SSIS package created by the wizard, you can open it in SQL Server Data Tools to customize it
and reuse it. For info about how to customize the saved package and run it again later, see Save SSIS Package.

See also
Get started with this simple example of the Import and Export Wizard
Data Type Mapping in the SQL Server Import and
Export Wizard
11/20/2017 • 2 min to read • Edit Online

In the SQL Server Import and Export Wizard, you can set the name, the data type, and the data type properties of
columns in new destination tables and files, but you can't specify custom conversions for column values. As a
result, the built-in mapping of data types from source to destination is important.

How does the wizard map data types between source and destination?
The wizard uses mapping files that are installed by SQL Server Integration Services to map data types from one
database system or version to another. For example, it can map from SQL Server data types to Oracle data types.
By default, the mapping files in XML format are installed in the following folders.
C:\Program Files\Microsoft SQL Server\130\DTSMappingFiles\ (for 64-bit)
C:\Program Files (x86)\Microsoft SQL Server\130\DTSMappingFiles\ (for 32-bit).
If you edit an existing mapping file, or add a new mapping file to the folder, you have to close and reopen
the SQL Server Import and Export Wizard or SQL Server Data Tools (SSDT) to load the new or changed
mapping file.

You can change an existing mapping file


If your business requires different mappings between data types, you can update the mapping files to change the
mappings used by the wizard. For example, if you want the SQL Server nchar data type to map to the DB2
GRAPHIC data type instead of the DB2 VARGRAPHIC data type when you transfer data from SQL Server to DB2,
you can change the nchar mapping in the SqlClientToIBMDB2.xml mapping file to use GRAPHIC instead of
VARGRAPHIC.

You can add a new mapping file


Integration Services installs mappings between many commonly used combinations of source and destination.
You can also add new mapping files to the MappingFiles directory to support additional sources and
destinations. The new mapping files must conform to the published XSD schema and must map between a unique
combination of source and destination. The schema for mapping files, DataTypeMapping.xsd, is published here.

Sample mapping file


Here's a portion of the XML mapping file that maps from SQL Server data types (or, more specifically, from the
data types used by the .Net Framework Data Provider for SQL Server) to Oracle data types. As one example, you
can see that a SQL Server int data type maps to an Oracle INTEGER data type.
<dtm:DataTypeMappings
xmlns:dtm="http://www.microsoft.com/SqlServer/Dts/DataTypeMapping.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SourceType="System.Data.SqlClient.SqlConnection"
MinSourceVersion="*"
MaxSourceVersion="*"
DestinationType="MSDAORA;OraOLEDB.Oracle;System.Data.OracleClient.OracleConnection"
MinDestinationVersion="08.*"
MaxDestinationVersion="*">

<!-- smallint -->


<dtm:DataTypeMapping >
<dtm:SourceDataType>
<dtm:DataTypeName>smallint</dtm:DataTypeName>
</dtm:SourceDataType>
<dtm:DestinationDataType>
<dtm:SimpleType>
<dtm:DataTypeName>INTEGER</dtm:DataTypeName>
</dtm:SimpleType>
</dtm:DestinationDataType>
</dtm:DataTypeMapping>

<!-- int -->


<dtm:DataTypeMapping >
<dtm:SourceDataType>
<dtm:DataTypeName>int</dtm:DataTypeName>
</dtm:SourceDataType>
<dtm:DestinationDataType>
<dtm:SimpleType>
<dtm:DataTypeName>INTEGER</dtm:DataTypeName>
</dtm:SimpleType>
</dtm:DestinationDataType>
</dtm:DataTypeMapping>

...

</dtm:DataTypeMappings>

You might also like