rendered paste body<cfquery name="qryAddUserGroups" datasource="#request.datasource#">
DELETE
FROM tblUserGroups
WHERE UserID = <cfqueryparam value="#attributes.UserID#" cfsqltype="cf_sql_integer">
<cfif isdefined("attributes.EmployeeGroupsList") and len(trim(attributes.EmployeeGroupsList))>
<cfoutput query="qryGroups">
<cfif ListFind(attributes.EmployeeGroupsList,qryGroups.GroupID,',')>
INSERT INTO tblUserGroups(UserID,GroupID,EnteredbyIP,EnteredByUser,DateEntered)
VALUES (<cfqueryparam value="#attributes.UserID#" cfsqltype="cf_sql_integer">,
<cfqueryparam value="#qryGroups.GroupID#" cfsqltype="cf_sql_integer">,
<cfqueryparam value="#CGI.REMOTE_ADDR#" cfsqltype="cf_sql_varchar">,
<cfqueryparam value="#variables.UserID#" cfsqltype="cf_sql_integer">,
#CreateODBCDateTime(Now())#
);
</cfif>
</cfoutput>
</cfif>
</cfquery>