Link to home
Start Free TrialLog in
Avatar of bjames
bjames

asked on

Getting Data Into SQL From Access

I need to move data from an Access database to a SQL Server database, and I have only a few days to get it done.

Knowing Access and being a complete novice at SQL Server (we're on the new Beta version) I decided to do a 'quick and dirty' port from Access by linking to SQL Server and just filling the tables up on the Access side.

But I have run into problems with tables containing Identity columns. They won't accept my data and when I try to use the SET IDENTITY_INSERT {table} ON I get a permissions errors. And yet my connection is for the sa.

What am I missing? Is there a better (faster) way to get my data from Access to SQL Server in an automated process?
Avatar of NateT
NateT

export all the tables data out to tab delim files and use bcp to import the data.  I think the sql 7.0 has a gui interface to do this, but if you have to go the cmd line route and need some help with syntax let me know.
There are tools available on the net for download, try to browse for MSACCESS97 UPSIZING TOOLS. What you can do with this is you can upsize your existing access tables to the sql server.
Avatar of bjames

ASKER

I guess I was hoping more to know how it could be done via MS-Access as our company intends to use both SQL Server and Access as back ends to our software. SQL will be for large customers and Access will be for smaller customers who cannot justify the cost of migrating up at this time.

My mandate (for the present) is to create a single product which moves data to either SQL or Access. Right now I have an Access product which moves data to Access, but it isn't so clean going to SQL.

My current solution has been to create a matching set of tables in SQL which do not have Identity columns and move the data there first. Then, within SQL I am able to issue the command SET IDENTITY_INSERT {table} ON and move the data again. But I was wondering if there is a way I can move the data in a single step via Access.

ASKER CERTIFIED SOLUTION
Avatar of aumdavis
aumdavis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bjames

ASKER

It isn't exactly what I was hoping for, but I'm now thinking that what I want to do probably cannot be done. The tables I want to send data to already exist, so creating new tables as I move the data is about the same as what I'm doing now (keeping a copy of tables without the identity constraint to receive the data. In either case I must port the data from the 'temporary' tables into the actual 'live' tables. (Importing data is not necessarily a one-time event.)

But I'm assuming now that pushing data from MS-Access directly into an existing SQL table with an identity constraint is not doable. There must be an intermediate table or file to receive the data first.

Thanks