Is there a way to loop through a list in T-SQL?

I would like to pass a list of user ids to a sp and then update records
based upon that list.

the code I am trying to replace woul be something like this:

<cfloop list="#attributes.user_id#" index="user">
        <cfquery datasource="mline">
                UPDATE users
                SET user_enabled = 
#iif(evaluate('attributes.user_'&user&'_enabled'),0,1)#
                WHERE user_id = #user#
        </cfquery>
</cfloop>

TIA

Colin


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