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)
 Auto Incrementing column without using an Identity

Author  Topic 

tkirk
Starting Member

4 Posts

Posted - 2000-11-30 : 11:32:31
I have a situation where I need a few tables in my database to emulate an identity column. So I need to find a safe way to lock the table, get the last value from the ID column, add 1, store the record then unlock the table. I've tried it a few ways on my own but it some cases I still manage to get duplicate IDs

My questions are:

1: Is it easier to do this through just SQL commands/statements or would it be easier to code it by hand from Visual Basic 6 (which is what I'm writing the application in)?

2: Is it easier to do this with SQL Server 7 or SQL Server 2000?

3: What are some of the ways people are doing it now?

Thanks a Lot!
Tony Kirk

Edited by - tkirk on 11/30/2000 15:31:06
   

- Advertisement -