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)
 patindex

Author  Topic 

ppalla
Starting Member

1 Post

Posted - 2002-01-02 : 17:50:33
How do I use use patindex function to filter values where it doesn't match the pattern



Edited by - Merkin on 01/02/2002 21:04:01

izaltsman
A custom title

1139 Posts

Posted - 2002-01-02 : 18:40:19
Shouldn't this be in a T-SQL forum?

Anyhow, you could run the following to pull records that don't match your pattern:

SELECT * FROM #yourtable WHERE somefield NOT LIKE '%your_pattern%'



Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-01-02 : 21:04:43
It is now....

Damian
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-01-03 : 13:24:08
If you're insistent upon using patindex then do something like

WHERE patindex(....) = 0

But I don't know if that's any better than Ilya's answer.
--------------------------------------------------------------
1000 Posts, Here I come! I wonder what my new title will be...

Edited by - AjarnMark on 01/03/2002 13:24:38
Go to Top of Page
   

- Advertisement -