Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 668723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:04:21+00:00 2026-05-14T00:04:21+00:00

I have an Access database (in Access 2003) with several tables, and data must

  • 0

I have an Access database (in Access 2003) with several tables, and data must be imported to Sql Server 2005. Access data does not have the same structure as sql server database, so I created various queries which transforms it to format needed by Sql Server. Basically for each table in sql server I have two queries: a Select query which generates the fieldnames and types compatible with sql table, and an Append query which basically does

Insert into [Sql_table] (field1, field2, ...)
Select [field1, field2, ...] from [Access_table]

Both Sql and original access tables have primary key Autoinc, and I include it in the query.

When I run the insert query and the source select query have not very many records (up to few hundreds) all works ok, the records are inserted ok, with the original identity

But when the source query have more records (I have few tables with over 10000 records), I have two situations:

  1. either Access reports the query cannot add any records to sql server due to primary key violation (but there is no violation at all). In this case I simply close access and restart it … and I get to second situation

  2. running the query Access tells me it cannot import x records (usually few, 10, 21, 32, usually seems random number up to 100 out of 10000+) due to primary key violation, but imports the rest. Again, there’s no key violation anyway, all ID’s are unique, as generated in original Access table by autoinc field. The strange thing is , if I delete sql data and run query again, I get different number of records not imported, sometimes few, sometimes more, but all in range of 10-50 out of 10000

I tried with Access 2007 too, but the same thing happens.

The Sql server table has foreign key relation to a master table, but this relation is also satisfied by data I try to import.

Does anyone knows faced this problem and know for a solution?

Thanks

PS: I don’t use sql server import wizard since there will be way to much work to convert access data through sql server – the access select queries are already made, they are quite complex, use some functions written in VBA, which would be difficult to rewrite to tsql just for this only purpose

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:04:21+00:00Added an answer on May 14, 2026 at 12:04 am

    I’ve run across things like this many time. Access’s error messages are often misleading. I don’t have a direct answer for you, but here’s what I would do ..

    Create an empty table matching the structure of the destination sql server table in sql server, but don’t put any constraints on it.

    Then copy the access data into that table instead.

    Now use management studio (or your whatever sql interface you use) and do an insert from the fake table into the real one. If it works, then I’m not sure what to tell you. If it doesn’t work, your management studio should give you a much better error message so you can figure out what’s up.

    -Don

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Access 2003 database that connects to a SQL Server 2008 box
I am upscaling an access 2003 database to SQL Server Express 2008. The tables
I have an Access 2003 database MDB where all of the tables exist as
I have an Access 2003 project in which all data is stored in SQL
I have an access database with 3 tables. People Gifts PeopleGifts Using VS 2008,
I have an access database with many tables. I am looking for a field
I have an access database on a windows machine, which I must import into
I have an Access 2003 database that makes use of a combobox that contains
I have been successful in querying a Microsoft Access 2003 database (.mdb file) and
I have a database in Access 2003 that I only want certain people to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.