We ran into this once before and according to Allaire when CFQUERY evaluates
a multi statement argument it waits for the SQL server to respond and
specifically looks for the text 'X Rows Returned'  Once CFQUERY sees this
statement it stops evaluating any additional information returned.  A work
around would be to use a NOCOUNT and also wrap your queries in SQL
TRANSACTION.  So some example syntax would be:

SET NOCOUNT ON          (Turns off Record Count Dialog)
BEGIN TRANSACTION       (Begins a Transaction)
INSERT INTO SomeTable (SomeField) VALUES ('SomeValue')
SELECT @@IDENTITY AS NewID
COMMIT TRANSACTION      (ends a Transaction)
SET NOCOUNT OFF         (Important as this is a system state and would
remain set)

Hope that helps

----- 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
>
>
>
> Rif
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to