You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)](../../ssms/download-sql-server-management-studio-ssms.md).
94
94
@@ -100,13 +100,13 @@ If you don't have SQL Server installed, or you have SQL Server but don't have SQ
100
100
101
101
- On the **Project** menu, 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)](../../ssdt/download-sql-server-data-tools-ssdt.md).
112
112
@@ -129,14 +129,17 @@ Here are some other basic tasks.
129
129
130
130
-**See a quick example of how the wizard works.**
131
131
132
-
-**If you prefer to see screen shots.** Look at this simple example on a single page - [Get started with this simple example of the Import and Export Wizard](../../integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard.md).
132
+
-**If you prefer to see screenshots.** Look at this simple example on a single page - [Get started with this simple example of the Import and Export Wizard](../../integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard.md).
133
133
134
134
-**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](https://go.microsoft.com/fwlink/?linkid=829049).
135
135
136
136
-**Learn more about how the wizard works.**
137
+
-**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](../../integration-services/import-export-data/import-and-export-data-with-the-sql-server-import-and-export-wizard.md).
138
+
-**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](../../integration-services/import-export-data/steps-in-the-sql-server-import-and-export-wizard.md). There's also a separate page of documentation for each page of the wizard.
139
+
-**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](../../integration-services/import-export-data/connect-to-data-sources-with-the-sql-server-import-and-export-wizard.md). There's a separate page of documentation for each of several commonly used data sources.
137
140
138
-
-**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](../../integration-services/import-export-data/import-and-export-data-with-the-sql-server-import-and-export-wizard.md).
139
141
140
-
-**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](../../integration-services/import-export-data/steps-in-the-sql-server-import-and-export-wizard.md). There's also a separate page of documentation for each page of the wizard.
142
+
## Next steps
141
143
142
-
-**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](../../integration-services/import-export-data/connect-to-data-sources-with-the-sql-server-import-and-export-wizard.md). There's a separate page of documentation for each of several commonly used data sources.
144
+
-[Import and Export Data with the SQL Server Import and Export Wizard](../../integration-services/import-export-data/import-and-export-data-with-the-sql-server-import-and-export-wizard.md)
145
+
-[Get started with this simple example of the Import and Export Wizard](../../integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard.md)
Copy file name to clipboardExpand all lines: docs/relational-databases/import-export/import-data-from-excel-to-sql.md
+33-28Lines changed: 33 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Import data from Excel to SQL | Microsoft Docs"
3
3
description: This article describes methods to import data from Excel to SQL Server or Azure SQL Database. Some use a single step, others require an intermediate text file.
[!INCLUDE [SQL Server Azure SQL Database](../../includes/applies-to-version/sql-asdb.md)]
18
18
19
-
There are several ways to import data from Excel files to SQL Server or to Azure SQL Database. Some methods let you import data in a single step directly from Excel files; other methods require you to export your Excel data as text (CSV file) before you can import it. This article summarizes the frequently used methods and provides links for more detailed information.
19
+
There are several ways to import data from Excel files to SQL Server or to Azure SQL Database. Some methods let you import data in a single step directly from Excel files; other methods require you to export your Excel data as text (CSV file) before you can import it.
20
+
21
+
This article summarizes the frequently used methods and provides links for more detailed information. A complete description of complex tools and services like SSIS or Azure Data Factory is beyond the scope of this article. To learn more about the solution that interests you, follow the provided links.
20
22
21
23
## List of methods
22
24
25
+
There are a number of methods to import data from Excel. You may need to install [SQL Server Management Studio (SSMS)](../../ssms/download-sql-server-management-studio-ssms.md) to use some of these tools.
26
+
23
27
You can use the following tools to import data from Excel:
24
28
25
29
| Export to text first (SQL Server and SQL Database) | Directly from Excel (SQL Server on-premises only) |
@@ -33,52 +37,50 @@ You can use the following tools to import data from Excel:
33
37
34
38
If you want to import multiple worksheets from an Excel workbook, you typically have to run any of these tools once for each sheet.
35
39
36
-
A complete description of complex tools and services like SSIS or Azure Data Factory is beyond the scope of this list. To learn more about the solution that interests you, follow the provided links.
37
-
38
40
> [!IMPORTANT]
39
-
> For detailed info about connecting to Excel files, and about limitations and known issues for loading data from or to Excel files, see [Load data from or to Excel with SQL Server Integration Services (SSIS)](../../integration-services/load-data-to-from-excel-with-ssis.md).
41
+
> To learn more, see [limitations and known issues for loading data](../../integration-services/load-data-to-from-excel-with-ssis.md#issues-types) to or from Excel files.
40
42
41
-
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)](../../ssms/download-sql-server-management-studio-ssms.md).
42
43
43
-
## <aname="wiz"></a> SQL Server Import and Export Wizard
44
44
45
-
Import data directly from Excel files by stepping through the pages of the SQL Server Import and Export Wizard. Optionally, save the settings as a SQL Server Integration Services (SSIS) package that you can customize and reuse later.
45
+
## <aname="wiz"></a> Import and Export Wizard
46
+
47
+
Import data directly from Excel files by using the SQL Server Import and Export Wizard. You also have the option to save the settings as a SQL Server Integration Services (SSIS) package that you can customize and reuse later.
46
48
47
49
1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], connect to an instance of the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)][!INCLUDE[ssDE](../../includes/ssde-md.md)].

60
+
:::image type="content" source="media/excel-connection.png" alt-text="Connect to an Excel data source":::
60
61
61
-
For an example of using the wizard to import from Excel to SQL Server, see [Get started with this simple example of the Import and Export Wizard](../../integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard.md).
62
+
To learn more, review:
62
63
63
-
To learn about other ways to launch the Import and Export wizard, see [Start the SQL Server Import and Export Wizard](../../integration-services/import-export-data/start-the-sql-server-import-and-export-wizard.md).
64
+
-[Start the SQL Server Import and Export Wizard](../../integration-services/import-export-data/start-the-sql-server-import-and-export-wizard.md)
65
+
-[Get started with this simple example of the Import and Export Wizard](../../integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard.md)
64
66
65
-
## <aname="ssis"></a> SQL Server Integration Services (SSIS)
66
67
67
-
If you're familiar with SSIS and don't want to run the SQL Server Import and Export Wizard, create an SSIS package that uses the Excel Source and the SQL Server Destination in the data flow.
68
+
## <aname="ssis"></a> Integration Services (SSIS)
68
69
69
-
For more info about these SSIS components, see the following topics:
70
+
If you're familiar with SQL Server Integration Services (SSIS) and don't want to run the SQL Server Import and Export Wizard, create an SSIS package that uses the Excel Source and the SQL Server Destination in the data flow.
-[SQL Server Destination](../../integration-services/data-flow/sql-server-destination.md)
73
75
74
76
To start learning how to build SSIS packages, see the tutorial [How to Create an ETL Package](../../integration-services/ssis-how-to-create-an-etl-package.md).
75
77
76
-

78
+
:::image type="content" source="media/excel-to-sql-data-flow.png" alt-text="Components in the data flow":::
77
79
78
80
## <aname="openrowset"></a> OPENROWSET and linked servers
79
81
80
82
> [!IMPORTANT]
81
-
> In Azure SQL Database, you cannot import directly from Excel. You must first export the data to a text (CSV) file. For examples, see [Example](import-bulk-data-by-using-bulk-insert-or-openrowset-bulk-sql-server.md).
83
+
> In Azure SQL Database, you cannot import directly from Excel. You must first [export the data to a text (CSV) file](import-bulk-data-by-using-bulk-insert-or-openrowset-bulk-sql-server.md).
82
84
83
85
> [!NOTE]
84
86
> The ACE provider (formerly the Jet provider) that connects to Excel data sources is intended for interactive client-side use. If you use the ACE provider on SQL Server, especially in automated processes or processes running in parallel, you may see unexpected results.
@@ -88,7 +90,7 @@ To start learning how to build SSIS packages, see the tutorial [How to Create an
88
90
Import data directly into SQL Server from Excel files by using the Transact-SQL `OPENROWSET` or `OPENDATASOURCE` function. This usage is called a *distributed query*.
89
91
90
92
> [!IMPORTANT]
91
-
> In Azure SQL Database, you cannot import directly from Excel. You must first export the data to a test (CSV) file. For examples, see [Example](import-bulk-data-by-using-bulk-insert-or-openrowset-bulk-sql-server.md).
93
+
> In Azure SQL Database, you cannot import directly from Excel. You must first [export the data to a text (CSV) file](import-bulk-data-by-using-bulk-insert-or-openrowset-bulk-sql-server.md).
92
94
93
95
Before you can run a distributed query, you have to enable the `ad hoc distributed queries` server configuration option, as shown in the following example. For more info, see [ad hoc distributed queries Server Configuration Option](../../database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option.md).
94
96
@@ -129,9 +131,9 @@ To query the Excel data without importing it, just use the standard `SELECT ...
129
131
130
132
For more info about distributed queries, see the following topics:
131
133
132
-
-[Distributed Queries](/previous-versions/sql/sql-server-2008-r2/ms188721(v=sql.105)) (Distributed queries are still supported in SQL Server 2016, but the documentation for this feature has not been updated.)
134
+
-[Distributed Queries](/previous-versions/sql/sql-server-2008-r2/ms188721(v=sql.105)) (Distributed queries are still supported in SQL Server 2019, but the documentation for this feature has not been updated.)
@@ -238,9 +240,9 @@ For more info about BCP, see the following topics:
238
240
-[bcp Utility](../../tools/bcp-utility.md)
239
241
-[Prepare Data for Bulk Export or Import](../../relational-databases/import-export/prepare-data-for-bulk-export-or-import-sql-server.md)
240
242
241
-
## <aname="adf-wiz"></a> Copy Wizard (Azure Data Factory)
243
+
## <aname="adf-wiz"></a> Copy Wizard (ADF)
242
244
243
-
Import data saved as text files by stepping through the pages of the Azure Data Factory Copy Wizard.
245
+
Import data saved as text files by stepping through the pages of the Azure Data Factory (ADF) Copy Wizard.
244
246
245
247
As described previously in the [Prerequisite](#prereq) section, you have to export your Excel data as text before you can use Azure Data Factory to import it. Data Factory can't read Excel files directly.
246
248
@@ -306,7 +308,7 @@ Msg 7438, Level 16, State 1, Line 3
306
308
The 32-bit OLE DB provider "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server.
307
309
```
308
310
309
-
### The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error
311
+
### The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error.
310
312
311
313
### Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"
312
314
@@ -324,6 +326,9 @@ Msg 7303, Level 16, State 1, Line 3
324
326
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
325
327
```
326
328
327
-
## See Also
329
+
## Next steps
328
330
329
-
[Import data from Excel or export data to Excel with SQL Server Integration Services (SSIS)](../../integration-services/load-data-to-from-excel-with-ssis.md)
331
+
-[Get started with this simple example of the Import and Export Wizard](../../integration-services/import-export-data/get-started-with-this-simple-example-of-the-import-and-export-wizard.md)
332
+
-[Import data from Excel or export data to Excel with SQL Server Integration Services (SSIS)](../../integration-services/load-data-to-from-excel-with-ssis.md)
333
+
-[bcp Utility](../../tools/bcp-utility.md)
334
+
-[Move data by using Copy Activity](/azure/data-factory/data-factory-data-movement-activities)
0 commit comments