If you're using SQL Server, try:

<cfquery name="qUpdate" datasource="#dsn#">
BEGIN TRAN
  update table
   set ID = "#ID#"
  where name = "#name#"
SELECT @@ROWCOUNT AS RecordCount
COMMIT TRAN
 </cfquery>

If you're using Access I think the only way to do it would be to run a
second query, after the update, like:

  select count(*)
  from table
  where name = "#name#"

Bob

-----Original Message-----
From: Mak Wing Lok [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 10:52 PM
To: CF-Talk
Subject: SQL update, how to count afftected rows?


how can i count the affected updated rows? if there any afftected record
count in CF?
for example if i run the SQL below, how can i know how many rows had been
affteced?

<cfquery name="qUpdate" datasource="#dsn#">
  update table
   set ID = "#ID#"
  where name = "#name#"
 </cfquery>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to