How do I get the next int value for a column before I do an insert in
MY SQL Server 2000? I'm currently using Oracle sequence and doing
something like:
select seq.nextval from dual;
Then I do my insert into 3 different table all using the same uniqueID.
I can't use the @@identity function because my application uses a
connection pool and it's not garanteed that a connection won't be used
by another request so under a lot of load there could be major problems
and this doens't work:
insert into <table>;
select @@identity;
This doesn't work because the select @@identity might give me the value
of an insert from someone else's request.
Thanks,
Brent
MY SQL Server 2000? I'm currently using Oracle sequence and doing
something like:
select seq.nextval from dual;
Then I do my insert into 3 different table all using the same uniqueID.
I can't use the @@identity function because my application uses a
connection pool and it's not garanteed that a connection won't be used
by another request so under a lot of load there could be major problems
and this doens't work:
insert into <table>;
select @@identity;
This doesn't work because the select @@identity might give me the value
of an insert from someone else's request.
Thanks,
Brent
Comment