Typically, I would recommend using a UUID for a primary key, have CF
generate it (consider altering the function to do a MS version of a UUID,
since you are using access and will likely go to MSSSQL Server, check
cflib.org for that), and then you can reference it easily without any
question that you are looking at the correct record.

Note, if you need a people friendly ID, then you can still follow the above
solution and use the UUID to get the people friendly ID.

- Calvin

-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 31, 2005 11:17 AM
To: CF-Talk
Subject: Re: grabbing the id of a newly created item..

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?
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192350
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

Reply via email to