<cfsetting showdebugoutput="false">
<cfsetting enablecfoutputonly="true">
<cfcontent type="application/json; charset=utf-8" reset="true">

<cfset targetBusinessID = 44>

<cfquery name="qUpdate" datasource="payfrit">
  UPDATE Employees
  SET BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#targetBusinessID#">
</cfquery>

<cfquery name="qCount" datasource="payfrit">
  SELECT COUNT(*) AS cnt FROM Employees WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#targetBusinessID#">
</cfquery>

<cfoutput>#serializeJSON({
  "OK": true,
  "MESSAGE": "All employee records reassigned to BusinessID #targetBusinessID#",
  "COUNT": qCount.cnt
})#</cfoutput>
