Home > SQL Development > [Database Normalization] Creating unique Identity (Pimary Keys)

[Database Normalization] Creating unique Identity (Pimary Keys)



Hi guys



I usually opt for the easy option of simply creating a primary key integer with increment by 1. However I would prefer to create a random value of a length say 30 characters.



Does anyone see any real benefit in this and if so is there some easy Sql command to create this on creating a record.



Help much appreciated.

    
Guest


do your self a favor and let the server handle your primary key generation.

Quote:
Originally Posted by urbanmike
Hi guys



I usually opt for the easy option of simply creating a primary key integer with increment by 1. However I would prefer to create a random value of a length say 30 characters.



Does anyone see any real benefit in this and if so is there some easy Sql command to create this on creating a record.



Help much appreciated.

Was this answer helpful ? Yes No   
Guest


Quote:
Originally Posted by urbanmike
Hi guys



I usually opt for the easy option of simply creating a primary key integer with increment by 1. However I would prefer to create a random value of a length say 30 characters.



Does anyone see any real benefit in this and if so is there some easy Sql command to create this on creating a record.



Help much appreciated.


Benfit? No. But you could use a GUID.

Was this answer helpful ? Yes No   
Guest


Here's a few articles regarding this:



http://www.informit.com/articles/ar...px?p=25862&rl=1



http://www.codinghorror.com/blog/archives/000817.html

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved