Search This Blog

Wednesday, February 27, 2013

Import data from Microsoft Access to SQL Server Without any Software



Problem

Tired of using SSIS packages to import data from Access to SQL Server? Is SQL Server Integration Services more complicated than what you are looking for?  Check out this tip to see how to import data from Access (Access 2007 or above) to SQL Server.

Solution

Microsoft has made importing data from Access much easier using Access 2007 or above than previous versions. Running SSIS packages or using the Import/Export wizard seemed time consuming and often would error out requiring more troubleshooting than it’s worth. I’m using an Access database with two tables named Customers and Orders for this tip:
Microsoft Access Table Viewer
First, make sure all tables are closed within in our Access database or we’ll get an error:
Microsoft Access Upsizing Wizard Error
Once all tables are closed navigate to Database Tools | SQL Server as shown below:
Microsoft Access Database Tools
After clicking SQL Server an Upsizing Wizard dialog box should appear. Since I don’t have a database created I will click “Create New Database” option as shown below.
Microsoft Access Upsizing Wizard Create Database
If there was already a database in place clicking “Use existing database” will bring up a few screens to setup a data source to a preexisting database. After clicking next, we need to enter some information to connect to our SQL Server and create our database. When specifying the Login ID make sure this user has CREATE DATABASE permissions on the server. For this example I will use SQL2008 for my server and create a database called Bama:
Microsoft Access Upsizing Wizard Connection String
After clicking next, you should see a dialog box displaying your Access tables in the left column. Simply click the tables you want to import and click the right arrow seen here 6 and click the "Next > " button. In this example we are importing the Customers and Orders tables as shown below:
Microsoft Access Upsizing Wizard Table Selection
The Upsizing wizard can export table attributes i.e. indexesdefaults, etc. as well as data as you can see in the next screen.
Microsoft Access Upsizing Wizard Table Attributes
After choosing your table attributes click "Next >" and you will see a dialog box where you can modify the existing application or create a new application to work with the database. I will choose “No application changes” for this example and click the "Finish" button.
Microsoft Access Upsizing Wizard Application Changes
The Upsizing wizard will then start importing data:
Microsoft Access Upsizing Wizard Progress
…and display the Upsizing Wizard Report:
Microsoft Access Upsizing Wizard Report
To confirm a successful import we can open SQL Server Management Studio and drill down to Databases where we will see our new database Bama, and our two new tables, Customers and Orders.
SQL Server Management Studio Object Browser
To confirm our data was imported we can query our Customers table using:
SELECT * FROM Customers

SQL Server Management Studio Query Results

No comments:

Post a Comment