Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Stored proc...Dynamic NOT IN LIST

Author  Topic 

ASP_DRUG_DEALER
Yak Posting Veteran

61 Posts

Posted - 2004-10-12 : 12:31:26
Hey all-
I need to do something like this, but am not sure how to do it.

spNEW
(
@inLIST as varchar(200)
)
as
select This, that, the, other from table where this not in (@inLIST);


Any tips on how this can be done? This only works with a single value.

Thanks,
Doug

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-10-12 : 12:35:26
select This, that, the, other from table where this charindex(','+this+',',','+@inLIST+',')=0

Corey
Go to Top of Page
   

- Advertisement -