Then there is no problem AFAIK can see from using it.
-----Original Message----- From: Clint Tredway [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 15:15 To: CF-Talk Subject: Re: Last ID inserted Yes, using @@Identity will send you back the LAST inserted ID in that query/stored proc... Which means, if you do 2 inserts in a stored proc and you do a Select @@Identity as RetId, RetId will be from the last insert. I just did this on SQL Server 7 and it produced this result... I can try on SQL 2000 later if I need to... On 4/18/05, Kerry <[EMAIL PROTECTED]> wrote: > >@@IDENTITY gives you the identity from the last insert in the > > database > > hmmm, BOL says: > "@@IDENTITY contains the last value generated in any table in the current > session" > > Anyone know what SQL defines as a session? i.e. is it just that query? > If so, then @@IDENTITY is 100% safe where I am doing single inserts per > query (no triggers in DB)... > > -----Original Message----- > From: Paul Hastings [mailto:[EMAIL PROTECTED] > Sent: 18 April 2005 15:00 > To: CF-Talk > Subject: Re: Last ID inserted > > Mike Kear wrote: > > Michael got the extract right. True, books on line doesnt say NOT to > > use @@identity, but it does say it's risky if there are several > > inserts going on at once. > > again, where exactly does it say that? > > > > > @@IDENTITY gives you the identity from the last insert in the > > database, whereever it was. Which might or might not be the one you > > that is an urban myth or a lack of understanding of how IDENTITY works, > take your pick. but repeatedly saying that sort of thing based on the > BoL as reference when it obviously isn't, doesn't make any sense to me. > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:203228 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