Monday, March 26, 2012

MS Sql Server and Windows 2000/XP

Hi, I have a problem.

I have two computers (clients), one with Windows 2000 and second with
Windows XP. And a third computer (server) with a Windows 2000 and MS Sql
Server 2000.

I have a TABLE with two rows: 'row' and 'row ' (space).

And SQL: 'select * from TABLE where row = 'row'

If I run this SQL on computer with Windows 2000 it works ok (return only one
row: 'row').
If I run this SQL on computer with Windows XP it works really strange
(return two rows: 'row' and 'row ' ) - it can't see this spaces.

Is there differences between MS Sql Server on W2000 and WXP?

Thanks for the help

Magdaslonk0 (slonk0_usun_to@.wp.pl) writes:
> I have two computers (clients), one with Windows 2000 and second with
> Windows XP. And a third computer (server) with a Windows 2000 and MS Sql
> Server 2000.
> I have a TABLE with two rows: 'row' and 'row ' (space).
> And SQL: 'select * from TABLE where row = 'row'
> If I run this SQL on computer with Windows 2000 it works ok (return only
> one row: 'row').
> If I run this SQL on computer with Windows XP it works really strange
> (return two rows: 'row' and 'row ' ) - it can't see this spaces.
> Is there differences between MS Sql Server on W2000 and WXP?

No, there isn't. There are however settings that you can change with
the SET command that may affect this. However, I am at loss to see
how you ever could get only one row back. You should always get two
back, because SQL does not care about trailing spaces when comparing.

Could you post a repro which demonstrates the problem? Such a repro
would have to create the table, insert the data, and then select.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||> how you ever could get only one row back. You should always get two
> back, because SQL does not care about trailing spaces when comparing.

Sorry, it was my mistake. You are right, SQL does not care about trailing
spaces when comparing.

Thanks for your help.
Magda

No comments:

Post a Comment