January 19, 2007 at 4:23 am
I am searching a table looking for instances of a field being broken with spaces.
eg. select blar blar from blar blar where textvalue like '% \f %'
(note the spaces between the %)
I know there are results matching this criteria, but the query comes back blank !
Can anyone help ???
January 19, 2007 at 6:51 am
Paul,
You could try using CHARINDEX (take a look in BOL) like this:
SELECT myCol FROM myTable WHERE CHARINDEX( ' ', myCol, 1 ) > 0
There is a space in between the apostrophes, honest!!
January 24, 2007 at 1:46 pm
Can you show us some data that does contain that string? For my little test, it does work.
DECLARE @WordSearch TABLE( Word varchar(100))
INSERT INTO @WordSearch
SELECT 'This string has \f in it'
UNION ALL
SELECT 'This string has |\f in it'
UNION ALL
SELECT 'This string does not have the text searched for in it'
SELECT * FROM @WordSearch WHERE Word LIKE '% \f %'
I wasn't born stupid - I had to study.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply