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.
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
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
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