Be careful with the ordering of the column_names array: it's very easy to parse input params and make a list of columns to be updated, but you need to make sure that the columns mentioned in the 'where' clause are ordered correctly and at the end of @column_names.