How are you doing the query? HQL, Criteria...?

    Diego


On Mon, Aug 16, 2010 at 10:28, Mujahid Ali <[email protected]> wrote:

> I am using nHibernate 2.1.2 with SQL Server 2008.
>
> ANSI_NULLS setting is turned on. I have a table with a 3 part
> composite key. If a part of this key is null, nHibernate does the null
> check using "=" instead of  "IS NULL".
>
> As an example:
>
> SELECT * from CURRENCY_TBL  WHERE  FROM_CUR = 'USD'  AND TO_CUR =
> 'EUR'  AND EFFDT = NULL
>
> which doesn't return any results where EFFDT is null;
>
> Instead, this query correctly returns results:
>
> SELECT * from CURRENCY_TBL  WHERE  FROM_CUR = 'USD'  AND TO_CUR =
> 'EUR'  AND EFFDT  IS NULL
>
>
> So, knowing that ANSI_NULLS is turned ON, how can I configure
> nHibernate to generate the null check using "IS NULL" vs  " = NULL" ?
>
>
> Thanks,
> Mujahid
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to