Yes that does work, unless you're not using an IDENTITY column.



------------------------
Strictly speaking, isn't that a bit risky?  You actually have 2 commands
in there, and I don't think they are treated as a unit transaction, are
they?  So another process could slip in there between those two on you,
and you *might* (unlikely, but...) get back the wrong ID.

If you're using SQL Server, you should use the @@identity feature, which
is guaranteed to be correct within your connection (in this case, with
CF's connection to the database), and therefore won't risk being
clobbered by another operation elsewhere.

Just a thought.  :P

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:6
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>

Get the mailserver that powers this list at 
http://www.coolfusion.com

                        

Reply via email to