db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Pugh <ep...@upstate.com>
Subject [SOURCE] Issue #TRQS131 - Should use IDENT_CURRENT('table_name') for identity
Date Wed, 29 Jan 2003 03:27:56 GMT
You can view the issue detail at the following URL:

Type :        Enhancement
Issue Id :    TRQS131
Reported by: Eric Pugh
             epugh@upstate.com - (epugh@upstate.com)


Summary: Should use IDENT_CURRENT('table_name') for identity
Description: Currently identities are returned by doing a select @@identity, however that
has global scope.  So, if torque does an insert into table Y, and then something does another
insert into table X, and then torque tries to get it's insert identity, it will return table
X's identity value!  Something safer is to use the syntax:
select IDENT_CURRENT('table_name'), and thus would do:
IDENT_CURRENT('Y') and narrow the chances of getting the wrong identity, especially if there
was a transaction.

Status: New
Priority: Medium
Vote: Medium

View raw message