Solved

Key of record just inserted

Posted on 2001-06-05
2
130 Views
Last Modified: 2013-12-24
Anyone know how to access the key of the record just inserted in a cfquery insert statement?
0
Comment
Question by:lauriepmissoula
2 Comments
 
LVL 1

Accepted Solution

by:
cfhub earned 100 total points
ID: 6156971
There are a couple of ways:

The "best" would also incorporate a CFTRANSACTION tag (just in case something goes wrong)

http://cfhub.com/advanced/cftransaction/example2.cfm



More simply, something like this should work (Access/MS SQL only)

http://www.cfhub.com/sql/accesstips/autonumber.cfm
0
 

Author Comment

by:lauriepmissoula
ID: 6157204
Thanks for the quick helpful response!
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question