Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Better yet, create the query as a stored procedure and put "SELECT @@IDENTITY AS thelatest" immediately after the insert; this way you won't have to put it inside a transaction in order to know that you've got the latest identity.
^_^
Copy link to clipboard
Copied
Take a look at the CFQUERY documentation. You can use IDENTITYCOL property of a result to get a new identity value. Note that IDENTITYCOL is MS SQL Server specific, see the documentation for the properties used for other databases.
CFQUERY
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_p-q_17.html#1102316