Re: Data checking problem...
From: Jacco Schalkwijk (jacco.please.reply_at_to.newsgroups.mvps.org.invalid)
Date: 08/24/04
- Next message: Wikus Schalkwyk: "Distince Count Problem"
- Previous message: dan: "Re: DTS and the Internet"
- In reply to: John: "Re: Data checking problem..."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 11:19:16 +0100
1. shows you all the rows that where the lastname column doesn't contains
_any_ of the a-z characters. In your case this is only satisfied by empty
strings, but it could also be satisfied by '1', '£%^&' or something similar.
(but not by '&*^a')
2. I made a typo in my post. LIKE '%^[a-z]%' doesn't make sense it this
case, because that looks for any string that includes something like '^a'.
That leaves us with:
3. Your 5 rows might include spaces (at the end)? Also, what is included
between a and z depends on the collation you have. In most collations
accented characters are ordered directly after or with the normal
characters.
-- Jacco Schalkwijk SQL Server MVP "John" <jtaylor@kmznet.com> wrote in message news:2our2pFe7d9tU1@uni-berlin.de... > Hey Jacco, > Why is this not working for me? I'd appreciate anyone's assistance, I've > been > attacking this with no signs of success. > I try: > 1. SELECT * FROM tablename where lastname NOT LIKE '%[a-z]%' > and it shows me two records where the lastname is blank. > 2. SELECT * FROM tablename where lastname LIKE '%^[a-z]%' > and it shows me no records. > 3. SELECT * FROM tablename where lastname LIKE '%[^a-z]%' > and it shows me all but 5 records (and those 5 records are just normal > names, no > strange characters or whathaveyou). > > What am I doing wrong? > Thanks. > > > "Jacco Schalkwijk" <jacco.please.reply@to.newsgroups.mvps.org.invalid> > wrote > in message news:uHXVMZSiEHA.4020@TK2MSFTNGP10.phx.gbl... >> Something like: >> >> IF firstname LIKE '%^[a-z]%' OR lastname LIKE '%[^a-z]%' >> >> ^ works as a logical not on the character or set of characters that > follows. >> >> -- >> Jacco Schalkwijk >> SQL Server MVP >> >> >> "John" <jtaylor@kmznet.com> wrote in message >> news:2ou7unFeq4q1U1@uni-berlin.de... >> >A relative dts/sql newbie and just seeing if anyone has >> > any ideas... >> > >> > Basically I need a task in my DTS package to check if >> > there are any non-alphabetic (anything that's not a-z) >> > characters in the first name and last name fields of a table, >> > then bust off an email if there is. >> > >> > I'm not too keen on creating a plethora of sql tasks to >> > search for every single non-alphabetic character, so does >> > anyone have any ideas how to condense my code? >> > >> > Thanks, >> > John >> > >> > >> >> > >
- Next message: Wikus Schalkwyk: "Distince Count Problem"
- Previous message: dan: "Re: DTS and the Internet"
- In reply to: John: "Re: Data checking problem..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|