Maybe this is not the right place but as I'm programming in c# for multiple database I'm trying here, if it's not good tell me where to write
This is the problem, I'm writing code for retrieving the last inserted autoincremental ID in a table in different databases.
I use sqlconnections and oracle connections.
I'm searching for a suggestion, it's better to use
begin trans
insert
select @@identity or select from sequence
commit
or
begin trans
insert
select max(id)
commit
What are the advanteges and disadvantages of the two solutions? sqlconnection and oracleconnection manage the two things in the same way? Select max is multiuser-safe?
There's a third way that is the best?
Thank in advance...I'm pretty confused
Stevie B. Gibson
This is the problem, I'm writing code for retrieving the last inserted autoincremental ID in a table in different databases.
I use sqlconnections and oracle connections.
I'm searching for a suggestion, it's better to use
begin trans
insert
select @@identity or select from sequence
commit
or
begin trans
insert
select max(id)
commit
What are the advanteges and disadvantages of the two solutions? sqlconnection and oracleconnection manage the two things in the same way? Select max is multiuser-safe?
There's a third way that is the best?
Thank in advance...I'm pretty confused
Stevie B. Gibson