Click to See Complete Forum and Search --> : Newbie Needs Help - Auto ID Generator


Chamark
01-27-2007, 06:33 PM
I am creating a SQL 2000 DB and need a self generating unique column that
would be cousin to the way MS-Access has autonumber, in that it would
increment automatically on insert. I have read enough in the threads not to
use INDENITY because I can't update the record (which I need to be able to do).

I know I can use DATETIME to get a unique ID which would probably confuse
the users since it looks like a date (1/2/1900). Any help is greatly
appreciated. Thanks

russell
01-28-2007, 10:44 AM
you are confused, or someone has posted bad info. use identity. you can update the record and this uniquely identifies the record.

Chamark
01-29-2007, 05:17 AM
Hey Russell...man you get around....I tried to do an Update using an IDENITY ID and an error came back from SQL 2000 that told me it could not update. I didn't make the IDENITY ID a primary key. It will generate an incrementing unique id, but won't let me update it.

russell
01-29-2007, 07:32 AM
u r updating the identity field itself? can i ask why? what's the point of having a unique value, then updating it? u can update the [i]other[/] fields, but you're rught, cant update identity col itself. what exactly re u trying to do?

Chamark
02-04-2007, 02:04 PM
Well Duh...I finally figured this out. So much to learn and so little time. As always thank you again very much!!!