Cant Import Records into a sql table

Posted on 2014-01-28
Medium Priority
Last Modified: 2014-01-28
I am trying to import an excel file into an sql table using ms access, however i am getting the attached error...
Is there a way to find out what exactly is preventing those records from being imported?
(I have tried looking into sql profiler, but didn't see anything under error column)
Question by:bfuchs
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 85
ID: 39816344
I don't see anything on the Word Doc. Just post a screenshot (image) of the error message. Many Experts won't even review your Word document ...
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 2000 total points
ID: 39816351
looking into the error it says it missed 1311 records due to key violations.

The only thing that I can think of is the primary key on the table... check what is the primary key on the table into which you are loading this data

and check if there are any duplicates with the primary key criteria and remove them from the input file.

Author Comment

ID: 39816385
hi, i think Surendra may be right...
however i am still unable to add those records due to the following
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 39816402
Hi Scott,
How do you insert an image?
when i click on the image icon above, it saves as attachment as you see above.
by right click/paste it doesn't work either.
LVL 16

Expert Comment

by:Surendra Nath
ID: 39816404
instead of you going back and forth, can you give us your input file here and also the create table script that you used to create the SQL table.

This will help us to pin point the issue and provide you a reliable solution quickly from both the ends.

if that is not feasible due to the red tape of your company (cofidential data ) then what you can do is something like below

1) see 34726 is an id right, check 34726 exists some where else as well, you have to remove it to get it to working.

you have to do it  too all the records, it is easy once you sort that in EXCEL by Id and check for duplicates over there.

Author Comment

ID: 39816416
Hi Serendra,
This latest error seems to be just a setting in the database (identity_insert), how do i set this on?
LVL 16

Accepted Solution

Surendra Nath earned 2000 total points
ID: 39816435
you have to use the below command to do it

SET IDENTITY_INSERT <your table name> ON

Open in new window


Author Closing Comment

ID: 39816463
thank you!
(however i am facing now another obstacle to this insert, i guess will post another question)

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question