IdList = 1,2,3,4,5,6,7,8,9,10
better:
Foreach(id in IdList)
Update MyTable set isDeleted = 1 where id = ?id
or
Update MyTable set isDeleted = 1 where id IN (?IdList)
Forgive my pseudocode, but I think it should be clear. I know there are limits to the size of the list in an IN clause. It used to be 255 in Oracle.
I'm thinking multiple sqls will be slower, but maybe parsing the IdList will cause more overhead for the DB Server. Would it be better if the list was sorted?