• If you need to know which characters have been found / or if found removed from the input string try this:

    DECLARE @Temp VARCHAR(30)

    DECLARE @Found VARCHAR(30)

    SET @Found =''

    SET @Temp = 'A<>B=1,! \|-*()%$#@!'

    SELECT @Temp AS 'Original input'

    BEGIN

    WHILE PATINDEX('%[^a-z^0-9]%', @Temp) > 0

    BEGIN

    SET @Found = @Found + (SELECT SUBSTRING(@Temp,PATINDEX('%[^a-z^0-9]%', @Temp),1))

    SET @Temp = STUFF(@Temp, PATINDEX('%[^a-z^0-9]%', @Temp), 1, '')

    END

    SELECT @Found AS 'Found'

    SELECT @Temp AS 'With characters removed'

    END

    Results:

    Found

    <>=,! \|-*()%$#@!

    With characters removed

    AB1

    Note that the above will NOT find or remove the '^' character.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]