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
 SQL Server Development (2000)
 Invalid Characters

Author  Topic 

KabirPatel
Yak Posting Veteran

54 Posts

Posted - 2007-08-23 : 10:33:55
Hi,

I would like to extract all records from a table that have non alpha numeric characters (such as £, $, % etc...).

What is the easiest way to do this?

Thanks in advance,
Kabir

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-23 : 10:51:08
select * from table1 where col1 like '%[^a-z]%'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

KabirPatel
Yak Posting Veteran

54 Posts

Posted - 2007-08-23 : 11:02:29

That works fine, except that I still get records with numbers.

I tried:

select * from table1 where col1 like '%[^a-z]%[^0-9]%'

but it didnt work. Any ideas?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-23 : 11:08:21
You wrote "alphanumeric" characters...

select * from table1 where col1 like '%[^a-z0-9]%'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

KabirPatel
Yak Posting Veteran

54 Posts

Posted - 2007-08-23 : 11:36:01

Thanks
Go to Top of Page
   

- Advertisement -