Solved

Key of record just inserted

Posted on 2001-06-05
2
127 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
Comment Utility
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
Comment Utility
Thanks for the quick helpful response!
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now