|
-
Aug 24th, 2006, 07:19 AM
#3
Re: SQL Server 2000 Cursor Problem
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|