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)
 Rogue Characters

Author  Topic 

rcr69er
Constraint Violating Yak Guru

327 Posts

Posted - 2007-11-23 : 10:25:43
Hi

I have just imported some data into a sql table. However I have noticed that there are a number of rogue characters such as '£' and '/' in fields such as the first name. Is there anyway to locate these rogue characters using sql?

Thanks

Ifor
Aged Yak Warrior

700 Posts

Posted - 2007-11-23 : 11:28:11
[code]-- *** Test Data ***
DECLARE @t TABLE
(
Surname varchar(30) NOT NULL
)
INSERT INTO @t
SELECT 'Smith' UNION ALL
SELECT 'Jones' UNION ALL
SELECT 'Smith-Jones' UNION ALL
SELECT 'Smith Jones' UNION ALL
SELECT 'O''Rouke' UNION ALL
SELECT 'Sm£th' UNION ALL
SELECT 'Smith-Jone$' UNION ALL
SELECT 'Jon/s'
-- *** End Test Data ***

SELECT *
FROM @t
WHERE Surname LIKE '%[^-,A-Z,a-z,'', ]%'[/code]

ps If your source data does not have the rouge characters you will need to look at how you are doing the import.
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-11-24 : 10:12:09
My son says Rogue Characters have a wide variety of skills to make up for a lack of combat prowess. They get hit-die six, so the only worse class is the sorcerer, with a die four hit dice. But their ability to sneak attack makes them invaluable to warrior characters for flanking bonuses. If they make a bluff check as a move action with improved feint, they can get a sneak attack bonus all by themselves, and the opponent loses their dexterity AC bonus.

e4 d5 xd5 Nf6
Go to Top of Page
   

- Advertisement -