the field gets padded with blanks after the name to fill up that field
that's why LIKE 'Woodford%' works
RTRIM() is a good solution
From: Harry Jega Nathan [mailto:hjeganathan@y...]
Sent: Wednesday, December 06, 2000 11:18 AM
To: sql language
Subject: [sql_language] Re: Sql Server bug??
WHERE RTRIM(Ward) = 'Woodford'
David Taylor <DTAYLOR@d...> wrote:
I'm using MS sql server 7.0 and running the Enterprise Manager.
I run the following as a test query:
WHERE Ward = 'Woodford'
which returns nothing, even though tons of records exist with Ward EXACTLY
equal to 'Woodford' - I know as I cut and paste it from the field itself.
If I use: Ward LIKE 'Woodford%', it works. There are no spaces before or
after the text(I got a few people to check). The field is defined as
varchar(30). Is it to do with the internal representation of the datatype?,
or a bug in SQL server?