Tuesday, November 6, 2007

Researching how to move data from Access to SQL Server 2005 automatically

Challenge: We have an access database. This is automatically updated and generated. We want to integrate this information with our website which uses SQL Server. So, how do we do it. This blog posts some of the research.

A lot of information seems to be based around migrating from access to sql server. But, this is not what we want.

Microsoft Data Transformation Systems seems to have our solution:
Links:
Good step by step of how to set it up: http://support.microsoft.com/kb/285829
Frequently asked questions page for DTS: http://msdn2.microsoft.com/en-us/library/ms345120.aspx#dtsfss05df_topic5
The last link told me to do a search for this string for more info on Access: Creating a Package Using the DTS Import/Export Wizard
First reference: Creating a DTS Package with the DTS Import/Export Wizard: http://msdn2.microsoft.com/en-us/library/aa176533(SQL.80).aspx

NOTES: You need to specify whether you are exporting data from an instance of Microsoft® SQL Server™ to another data source (for example, a second instance of SQL Server 2000) or importing data from another data source to an instance of SQL Server. Both choices are available in SQL Server Enterprise Manager, through the Data Transformation Services node of the console tree, and as command switches through the dtswiz command prompt utility

When you want to run the package.
You can run the package after the DTS Import/Export Wizard completes, or you can schedule the package to execute on a regular basis using SQL Server Agent.

You can use the Create Publication Wizard to publish the data. For more information, see Replication Wizards.


Important Do not open a Microsoft Excel file that is being used as a source or destination during the wizard creation or execution, because a "file in use" error will occur.

Start:
I went ahead and created a new sql server 2005 database for testing. Started out by right clicking on the database name, then tasks, then import/export. I chose a microsoft access database as the source, also chose to save this package for later use. Ran the program and the tables as well as all data were created in sql server.

Now that I created it, it looks like I can use a SQL Server Agent to schedule this to run when i need it to.
http://www.microsoft.com/technet/prodtechnol/sql/2005/newsqlagent.mspx

After reading more, only the systems admin has the right to grant someone access to create an agent. This may be an issue as hosting may not allow us to run agents. Double check on hosting, otherwise, this may be a dead end.

No comments: