Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sequence or uid generation function?

Author  Topic 

jzeil
Starting Member

4 Posts

Posted - 2002-11-14 : 14:13:39
Hi,
Does sql server have a sequence or uid generation function?

I have a java application and need to know the ID of the records that I insert. Currently Im using a auto incrementing field and selecting the max to get the record that I just inserted. This leads to a race condition though... if another record is inserted before I can get the one I just inserted Im in trouble.

Thanks

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-11-14 : 15:17:56
I think you are looking for an "Identity" or possibly "Unique Identifiers."

Take a look at these links
http://sqlteam.com/item.asp?ItemID=8003
http://sqlteam.com/item.asp?ItemID=283
http://sqlteam.com/SearchResults.asp?SearchTerms=identity

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -