If SET ANSI_NULLS is OFF than Null = Null evaluates to True. I don't know about any settings that could make Null = '' to evaluate to true. Aanyway it has nothing to do with Sql Server version (7 or 2000) but with it default or otherwise settings/configuration.
>Thanks a lot Sergey, I can use that.
> But let me ask you am I losing my mind?, did they changed that in SQL? 2000, because as far as I remember I could do a:
>
> SELECT * FROM MyTableName WHERE MyFieldName = ''
>
> in SQL 7 and it will return both NULLs and empty fields.
>
>
>
>>Here's how you query for nulls and empty string
>>SELECT * FROM MyTableName WHERE MyFieldName IS NULL
>>* Empty varchar filed
>>SELECT * FROM MyTableName WHERE LEN(MyFieldName)=0
>>
>>>Hi Everybody!
>>>I have an application that was devloped using VFP 6.0 SP4 and Microsoft SQL Server 7, we moved to VFP 7 SP1 and Microsoft SQL Server 2000 and after that
>>>we can not query on NULLS or empty spaces, something like this :
>>>
>>> SELECT * FROM MyTableName WHERE MyFieldName = NULL
>>>
>>> OR
>>>
>>> SELECT * FROM MyTableName WHERE MyFieldName = ''
>>>
>>>I tried these command from both SQL Analyzer or using SQL pass through from VFP and in both cases returned not records. Also, I tried setting the SET ANSI_NULLS ON/OFF without any results.
>>>
>>> Any suggestions ?
>>>
>>> THIS.Thanks("in advance")
--sb--