Solved

Key of record just inserted

Posted on 2001-06-05
2
131 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New OSQA server has a ton of fake users 4 78
WAMP server installation, getting error popups, DLLs missing 5 84
http to https 3 77
move expression web site to a new server 13 75
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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