Solved

Incremental Primary Key on CSV import

Posted on 2008-10-02
2
378 Views
Last Modified: 2013-11-24
Is it possible when importing via CSV in SQLyog to add lines with the same value for the Primary Key.
trying to add records to an existing database and some of the existing records have the same Primary Key value as some of the ones i am importing.

0
Comment
Question by:7softsteve
2 Comments
 
LVL 7

Expert Comment

by:mattaob
ID: 22623669
Primary key's are unique so you won't be able to add more than 1 column with the same primary key
0
 
LVL 20

Accepted Solution

by:
ElrondCT earned 500 total points
ID: 22629003
The whole point of a primary key is that it is unique, so there is some way to identify each record. If the field you're using needs to have duplicates, then you should create another field to use as the primary key, perhaps simply an auto-incrementing number. You don't have to have the database sorted for display by the primary key.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
Viewers will learn the different options available in the Backstage view in Excel 2013.

919 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

21 Experts available now in Live!

Get 1:1 Help Now