Dave/Barney/Casey... I'm using SQL 2005.
I just wanted to cover all bases and was looking for a code snippet. Thanks.

-----Original Message-----
From: Casey Dougall [mailto:[email protected]] 
Sent: Wednesday, April 28, 2010 2:13 PM
To: cf-talk
Subject: Re: SQL Gurus... obtaining the correct Incremental ID


On Wed, Apr 28, 2010 at 1:51 PM, Che Vilnonis <[email protected]> wrote:

>
> When using "set nocount on", "select @@identity as xyz" and "set 
> nocount off" in a cfquery, how can I be certain that two transactions 
> that occur at roughly the same time obtain the proper incremental id 
> from an Identity column? Is their a SQl equivalent to CF's cflock tag?
>
> Thanks, Che
>
>
 On MS SQL server I believe anyting above 2000 use the output clause

<cfquery>
insert into table
(col1, col2, col3)

output inserted.ID

values
(col1Val,col2Val,col3Val)
</cfquery>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333191
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to