Solved

Incremental Primary Key on CSV import

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This collection of functions covers all the normal rounding methods of just about any numeric value.
Creating and Managing Databases with phpMyAdmin in cPanel.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

786 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