Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PROBLEM: I want to use == on comparison of strings
Message
From
05/09/2003 14:06:18
 
 
To
05/09/2003 07:36:01
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00826335
Message ID:
00826559
Views:
22
>Hi,
>
>Sorry, my title is not exact.
>Exact is:
>"PROBLEM: i want use == on comparison of strings"
>
>If i define on SQL Server a field F1 CHAR(2) and insert a string like 'A ',
>SQL Server not found 'A'.
>Example:
>
>CREATE TABLE #mytable (f1 char(2) )
>INSERT INTO #mytable VALUES ('A ')
>SELECT * FROM #mytable WHERE f1='A' && <-- return empty rowset
>DROP TABLE #mytable
>
>

Hi Fabio,

May be I misunderstood you, but the SELECT command on SQL Server does return 1 record.

Here is the code:
set ANSI_DEFAULTS ON

CREATE TABLE #mytable (f1 char(2) )
INSERT INTO #mytable VALUES ('A ')
SELECT * FROM #mytable WHERE f1='A'
DROP TABLE #mytable 
go

set ANSI_DEFAULTS OFF

CREATE TABLE #mytable (f1 char(2) )
INSERT INTO #mytable VALUES ('A ')
SELECT * FROM #mytable WHERE f1='A'
DROP TABLE #mytable
And here is the result:
(1 row(s) affected)

f1   
---- 
A 

(1 row(s) affected)


(1 row(s) affected)

f1   
---- 
A 

(1 row(s) affected)
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform