On Fri, 13 Nov 2009 08:22:47 +1000, Angus Mann wrote:

>I need a unique identifier in an SQL table and for complicated reasons 
>I don't want to use auto-increment. [...]

So why not use a UUID/GUID as created by the DB? You don't specify which
DB server technology you're using, but:

* Microsoft SQL Server has uniqueidentifier and newid()
* Oracle has sys_guid()
* MySQL has uuid() and uuid_short()
* PostgreSQL has uuid and contributor function contrib/uuid-ossp

Or are you using something else which doesn't support UUIDs?

(Ash, maybe he's doing replication and can't rely on auto-increment
integers aligning across peers)
-- 
Ross McKay, Toronto, NSW Australia
"Let the laddie play wi the knife - he'll learn"
- The Wee Book of Calvin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to