Updating multiple rows using list of Ids
just use the ids as integers like so:
UPDATE mytbl
SET flag = 1
WHERE id in (1,2,3,....)
Try this:
UPDATE mytbl
SET flag = 1
WHERE @IdList LIKE CONCAT('%,',Id,',%');
Note that your varchar list @IdList
must start and end with comma (e.g. ,1,2,20,30,
).