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 2005 Forums
 Transact-SQL (2005)
 2005 wildcards

Author  Topic 

starnold
Yak Posting Veteran

83 Posts

Posted - 2008-10-15 : 09:17:31
I am trying to exclude a list of DB's from a script:

where name not in ('tempdb','master','model','msdb','admin','cascade_%')

But the % is not working as a wildcard?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-15 : 09:20:37
where name not in ('tempdb','master','model','msdb','admin') and name not like 'cascade_%'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-15 : 11:11:03
or use patindex

where name not in ('tempdb','master','model','msdb','admin') and patindex('cascade_%',name)=0
Go to Top of Page
   

- Advertisement -