Solved

Incremental Primary Key on CSV import

Posted on 2008-10-02
2
383 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

789 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