|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
unique id
hi
what is the purpose of unique id? if you are already using a field as a primary key, why would you using unique id? does it do something special??? thanks |
|
#2
|
|||
|
|||
|
I may be wrong on this (correct me if im wrong)
But if you tell a field that its unique, if you try to add the same data twice it wont let you. Say if you had a database for products, and on that you and a field for the barcode number, you would want that to be unique, so to stop people from entering the same number, you would specify the field as unique |
|
#3
|
|||
|
|||
|
but...
but doesn't the primary key () do that?
|
|
#4
|
|||
|
|||
|
Stuie,
From what I've learned and read, you're right... You would only need to specify the field as the primary key... In Ben's example, rather than using an ID system of "1...2...3...etc", you would use the "barcode" number as the ID and have that set as the primary key... That's just my opinion!
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#5
|
|||
|
|||
|
Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > unique id |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|