Skip to Content.
Sympa Menu

freetds - Re: [freetds] Unexpected results with null fields

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: KERTEL - Maxime MARAIS <mmarais AT kertel.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Unexpected results with null fields
  • Date: Tue, 06 Jun 2006 14:26:59 +0200

KERTEL - Maxime MARAIS a écrit :
ZIGLIO, Frediano, VF-IT a écrit :
Hello,

I am running a query looking like the following one (the one I use also select other fields):

SELECT id, isnull(
right('0'+convert(varchar,day(max(T.gdh))),2)
+right('0'+convert(varchar,month(max(T.gdh))),2)
+convert(varchar,year(max(T.gdh)))
+right('0'+convert(varchar,datepart(hour,max(T.gdh))),2)
+right('0'+convert(varchar,datepart(minute,max(T.gdh))),2)
,'010119700000')
FROM MyTable T
GROUP BY id

[...]
SET ANSI_NULLS only modifies the way SELECT * FROM myField = NULL is computed.
With SET ANSI_NULLS ON, this request never returns data (SELECT * FROM myField is NULL must be used instead)
With SET ANSI_NULLS OFF, this request returns rows where myField is NULL.

Read, of course, SELECT * FROM myTable WHERE myField = NULL... ;-)

--
Maxime MARAIS
Kertel.





Archive powered by MHonArc 2.6.24.

Top of Page