Solved

Incremental Primary Key on CSV import

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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 view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

758 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

19 Experts available now in Live!

Get 1:1 Help Now