IN () simply does not work that way.

IN ('A','B','C','D') works - those are hardwired values.

You should be building a temp table or table variable with each item you want selected as a separate row.

Then use

WHERE... EXISTS IN (SELECT IMEI FROM #TEMPTABLE)

or even better

FROM #TEMPTABLE TX
LEFT JOIN OTHERTABLES OX ON OX.IMEI=TX.IMEI

btw - avoid the CURSOR - use a loop.

Here's a thread that talks about this very issue

http://www.vbforums.com/showthread.p...ghlight=exists