Importing Excel Data into a SQL Table
Using the built-in Import and Export Data Utility
Importing data into a Microsoft SQL Server Database Table can be a little tricky. Things have changed from back in the days where the DTS packages were easy to configure (although SSIS is a more powerful alternative), if you want a very simple, very fast way to import data into your SQL Server Database from a Microsoft Excel file this is an extremely quick and easy way to do it.
The first thing to note, and this is very important, is that the 64-bit import tool does not natively open Microsoft Excel files.
Choose the 32-bit tool.
![]() |
| 32-bit Import/Export Tool |
When you open the Import/Export Wizard you will see the following dialogue box and will need to choose the data source. If you do not see a Microsoft Excel option then you may have accidentally opened the 64 Bit version of the wizard.
Once you have chosen Microsoft Excel as your data source the dialogue options will change and allow you to locate an excel file. Browse to or type in the location of your excel file.
Choose the database server and the database you wish to connect to.
If you need to add additional parameters or logic into the import, or want to import into an existing table based on existing data you can write a query to specify a data transfer. I'll cover that in another article but for now we are just going to import the data into a new table.
You will then be given an opportunity to either select a table in which you can import the data, or create a new table. I've created a new table called New_Contact_Table.
The import can then be imported immediately or it can be saved as a SSIS package which could be executed on a schedule or again at a later point in time.
The confirmation reiterates the configuration changes that you've selected.
When you click the finish button the status screen will show the progress, and if all goes well it will indicate that the data was exported properly into the database.
Finally as you can see the 9200 rows that were imported are verified.

From this point you can simply manipulate the data into an existing table or if you just needed the data imported into a SQL server then your job is done.
~Yati
















0 comments:
Post a Comment