--This script sets the "Use Change Points" flag for design groups that look like they contain --change points based on the mix codes. --Mix codes containing "xxxCP" or "CPxxx" (where xxx is a number) are assumed to be change points UPDATE DesignGroups SET DesignGroups.UseChangePoints = 1 FROM DesignGroups INNER JOIN DesignMixes ON DesignGroups.Code = DesignMixes.GroupCode WHERE (DesignMixes.Code LIKE '%CP[0-9][0-9][0-9]%' OR DesignMixes.Code LIKE '%[0-9][0-9][0-9]CP%') AND ISNULL(DesignGroups.UseChangePoints,0) = 0