p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

sql_language thread: Sql Server bug??

Message #1 by David Taylor <DTAYLOR@d...> on Tue, 5 Dec 2000 12:17:12 -0000
 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

-----Original Message-----
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??


FROM councillors
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: 

FROM councillors
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?

  Return to Index