Rif, the other suggestions everyone has given to your problem have been
great ideas.
If instead you want to keep with your original plan, I believe this will
help you do what you want:
<cfquery .... >
SET NOCOUNT ON
INSERT INTO Table_Name
( ...... )
VALUES
(........)
select @@identity AS New_Transaction_ID
SET NOCOUNT OFF
</cfquery>
I'm no database guru, but I work with one :). He gave me the "NOCOUNT"
syntax and it solved the problem. You should now be able to refer to
#queryname.New_Transaction_ID#
Hope that helps
Brian
----- Original Message -----
From: Rif Kiamil <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Friday, December 01, 2000 6:31 AM
Subject: CF Does not like MSSQL7 @@ROWCOUNT
> Dear All
>
> I have the flowing CF Code
>
> --- START -
>
> <cfparam name="AddInvoices.RowsAffected" default="NOTSET">
>
> <cfquery datasource="#DSNOperaDW#" name="AddInvoices">
> INSERT INTO [Images_Invoice_Index]
> (Invoice_ID, DirPath)
>
> SELECT CSVTemp.Inv_ID,
> CSVTemp.DIR
>
> FROM Images_INVPROJECT_CSVTempTable as CSVTemp
>
> WHERE (Doc_Type = 'I')
>
> SELECT @@ROWCOUNT as RowsAffected
> </cfquery>
>
>
> <cfoutput>#AddInvoices.RowsAffected#</cfoutput>
>
> -- END ---
>
>
> Now my Output should be a number but I just get my default param back
> NOTSET. If I run this query in MS Query Analyzer I will get the
following
> back
>
> ----- START ----
>
> (8 row(s) affected)
>
> RowsAffected
> ------------
> 8
>
> ------ END -------
>
>
> Any body know why CF does not pick up the 8 and how I can get it to
pick up
> the 8
>
>
> Thanks for your Time
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists