If your using MS SQL server there is an easier way to get the number
of rows effected by an update and delete.


<cfquery name="users" datasource="#request.dsn#">
 SET NOCOUNT ON

UPDATE user SET role = <cfqueryparam cfsqltype="cf_sql_varchar" value="newrole">
WHERE role = <cfqueryparam cfsqltype="cf_sql_varchar" value="oldrole">

select @@ROWCOUNT as numberModified from USER

SET NOCOUNT OFF

</cfquery>

if deleting just replace the update statement with the delete
statement but leave the other things alone..

you could then reference this number as users.numberModified



-- 
Bill
http://blog.rawlinson.us
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
[EMAIL PROTECTED]

Reply via email to