Originally posted by: Gnurb
there's a sql function for this: LAST_INSERT_ID()
if you're using php, you can use mysql_insert_id() in your php code
Originally posted by: TechBoyJK
it needs to work with ms sql
Originally posted by: TechBoyJK
well I'm using coldfusion, so i wrapped two queries in a <cftransaction> tag.
I do the insert query, and within the same transaction tag, i run another query to find the max id of the table I just inserted to.
I'm still curious as to how to implement the select scope identity. do i use that during the same query that creates the record?
Originally posted by: TechBoyJK
well I'm using coldfusion, so i wrapped two queries in a <cftransaction> tag.
I do the insert query, and within the same transaction tag, i run another query to find the max id of the table I just inserted to.
I'm still curious as to how to implement the select scope identity. do i use that during the same query that creates the record?