• number of columns = expected number of commas + 1

    something like a while loop would allow you to iterate with charindex to a point after the last #expected#, then a single charindex finds/doesn't find the extra.