Solved

Cant Import Records into a sql table

Posted on 2014-01-28
8
381 Views
Last Modified: 2014-01-28
hi,
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)
1-28-14.doc
0
Comment
Question by:bfuchs
  • 4
  • 3
8 Comments
 
LVL 84
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 ...
0
 
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 500 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.
0
 
LVL 3

Author Comment

by:bfuchs
ID: 39816385
hi, i think Surendra may be right...
however i am still unable to add those records due to the following
1-28-14.doc
0
 
LVL 3

Author Comment

by:bfuchs
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.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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.
0
 
LVL 3

Author Comment

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

Accepted Solution

by:
Surendra Nath earned 500 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

0
 
LVL 3

Author Closing Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now