Steve,

 

As far as I know this setting is not on my default, and as the setting means
it will not return the number of rows affected.

 

 

Regards,

Andrew Scott

 <http://www.andyscott.id.au/> http://www.andyscott.id.au/

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf
Of Steve Onnis
Sent: Monday, 16 August 2010 12:54 PM
To: [email protected]
Subject: RE: [cfaussie] CF8 and MSSQL 2005/2008

 

what version of SQL though? I havent had any issues with it either till i
started using SQL2005

 

the SET NOCOUNT ON/OFF seems to work

 

  _____  

From: Paul Kukiel [mailto:[email protected]] 
Sent: Monday, 16 August 2010 8:42 AM
To: [email protected]
Subject: Re: [cfaussie] CF8 and MSSQL 2005/2008

I agree.  Where we are not using result attribute on older code we use
scope_identity() without issues on CF8 and we have never changed drivers.

Paul.

On 16/08/2010 8:02 AM, Scott Thornton wrote: 

I have seen similar behaviour, I think it was with CF 8.

Using the Set nocount on option seemed to help.

<cfquery datasource="ds" name="qInsert">

set nocount on

INSERT 

INTO TableName (Col1)

VALUES ('foobar')

SELECT @@IDENTITY AS 'NewID'

Set nocount off

</cfquery>

PS: SCOPE_IDENTITY() is a better choice. You never know when your table may
have an underlying insert trigger..

From: [email protected] [mailto:[email protected]] On Behalf
Of Paul Kukiel
Sent: Friday, 13 August 2010 5:27 PM
To: [email protected]
Subject: Re: [cfaussie] CF8 and MSSQL 2005/2008

Steve don't use @@identity you can achieve this result with CF alone:

http://cookbooks.adobe.com/post_Getting_the_ID_of_the_Last_Record_Inserted_I
nto_a-16522.html

and with CF9 its more generic:

http://cookbooks.adobe.com/post_Generated_key___Get_the_ID_of_the_inserted_r
ecord-16593.html

Paul.

On Fri, Aug 13, 2010 at 5:19 PM, Steve Onnis <[email protected]> wrote:

Is there an updated driver for SQL Server?  I have come across this issue
where if i run this query:-

<cfquery datasource="ds" name="qInsert">

INSERT 

INTO TableName (Col1)

VALUES ('foobar')

SELECT @@IDENTITY AS 'NewID'

</cfquery>

Under CF8 it errors saying qInsert is undefined but under CF9 it runs fine.

Steve

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]
<mailto:cfaussie%[email protected]> .
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.




-- 
Paul Kukiel

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to