select @@identity from tableName will return the last inserted id, assuming mssql
tw On Mon, 31 Jan 2005 16:09:10 -0000, Craig Dudley <[EMAIL PROTECTED]> wrote: > Which DB are you using? > > -----Original Message----- > From: Protoculture [mailto:[EMAIL PROTECTED] > Sent: 31 January 2005 15:10 > To: CF-Talk > Subject: grabbing the id of a newly created item.. > > How would I modify an insert query to grab the id ( autonum, primary key > ) of the item that I just inserted? > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192336 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54