Over the next few days we are going to start the migration to a new forum application. I'm going to start with high post count and active users. You may receive an invitation to the new forums. It's not spam. It's just me trying to seed the user base. My goal is to open it up over the weekend.

Once we open the site we'll block registrations here. We should be open shortly on the new site.

SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Where mystring not like (list of items)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

89 Posts

Posted - 08/04/2011 :  09:21:15  Show Profile  Reply with Quote
If I have:
...where myString not like '%abc' and myString not like 'xyz%' and myString not like '%aaa' and myString not like 'ert%'...

is there a way to shorten this, using "NOT IN" and somehow just list all the strings that I don't want it to match?


Very Important crosS Applying yaK Herder

52326 Posts

Posted - 08/04/2011 :  09:29:43  Show Profile  Reply with Quote
you can add the search strings onto a temporary table and use it in join on condition like

ON t1.Col1 NOT LIKE '%' + temp.Pattern

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000