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_Into_a-16522.html
<http://cookbooks.adobe.com/post_Getting_the_ID_of_the_Last_Record_Inserted_Into_a-16522.html>and with CF9 its more generic: http://cookbooks.adobe.com/post_Generated_key___Get_the_ID_of_the_inserted_record-16593.html <http://cookbooks.adobe.com/post_Generated_key___Get_the_ID_of_the_inserted_record-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]<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.
