![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 (AT) kmznet (DOT) com> wrote in message news:2ou7unFeq4q1U1 (AT) uni-berlin (DOT) 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 |
#4
| |||
| |||
|
|
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 (AT) to (DOT) newsgroups.mvps.org.invalid wrote in message news:uHXVMZSiEHA.4020 (AT) TK2MSFTNGP10 (DOT) 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 (AT) kmznet (DOT) com> wrote in message news:2ou7unFeq4q1U1 (AT) uni-berlin (DOT) 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |