Hello, in SQL 2000 I have an UPDATE statement that uses a REPLACE, however it is doing something I did not expect by matching more than I want. To test I am using
Why is it matching the N that does not have a space after it?
Do I need something special to check for matching a space?
I have also put in several spaces after the N and it still matched.
Thank you for your assistance.
djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
Code:
SELECT City, CASE WHEN City LIKE 'N %' THEN REPLACE(City, 'N ', 'NORTH ') END
FROM #Temp1
WHERE City LIKE 'N %'
--Input: N RICHLND HILLS
--Output: NORTH RICHLNORTHD HILLS
Do I need something special to check for matching a space?
I have also put in several spaces after the N and it still matched.
Thank you for your assistance.
djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!