No More NULL

  • Good one!

    But surely it's more likely we'll see a new "Known Null", to contrast with "Unknown Null"....

  • Instead of an arbitrary baseline of 1/1/1900 for datetime, maybe something more memorable....like 4/1/1900?

  • tlough (4/1/2010)


    Instead of an arbitrary baseline of 1/1/1900 for datetime, maybe something more memorable....like 4/1/1900?

    What's special about the 4th of January? ๐Ÿ˜‰

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • or in another format it's 1st April....?

    ๐Ÿ˜›

  • great spotted all the april fools jokes so far to day except this one

  • Hi,

    To NULL or not to NULL. Its perhaps my IQ, but after years I'm still struggling with nulls. I consequently used to implement default values instead of NULLs, just to work around the NULL issues. Now I understand the meaning of NULL as in F=female,M=male, NULL=unknown ...

    In GUI development it's often not described in the functional analysis. The example above I can handle easily with radiobuttons (female/male/unknown) but for other type of fields it's not always that obvious. If I have a blank textbox, should I return NULL or should I return '' to the database ... or should I in all scenarios put an aditional checkbox next to the textbox with the remark "unknown" although that was not specified by the analysists?

    Finally, at this moment I have to write a daily procedure that loops data in a source database and updates specific fields in a destination database. If the matching key is absent in the destination database I insert. I the key exists in the destination, but no longer in the source I (logically) delete the row. In case the matching key exists in both databases I have to update, but only when some fields are changed ... and here I'm struggling again since it seems my approach does not always work ...

    IF EXISTS (SELECT * FROM [dbo].

    WHERE

    = @key

    AND

    (f1 <> @f1

    OR f2 <> @f2

    OR ...)

    BEGIN

    UPDATE ...

    SET modificationdate = getdate(),

    ...

    WHERE = @key

    It's about CASTS, or leading and trailing blancs (LTRIM/RTRIM), etc but also about comparing NULL with NULL or NULL with 0 or ''. So now I'm looking for a best approach to update only when something has really changed without making the error update is not executed while eg NULL has become 0.

    Can someone point me a URL with best approach regarding my need?

    Thanks in advance

    Peter.

  • Okay Steve, feel responsible for my broken screen ๐Ÿ™‚

  • Wow.

    I was just about to send this to my team saying... "see, I was right, nulls are bad and we are going to be doing things my way afterall"...

    Then, I thought, "this is too good... though I seldom if ever comment on an article... I just have to put in my comment saying "it is about time"...

    Now, I am sad.

    Oh well, let's hope for the best anyway.

    Nice joke.

    -- Mark Kamoski

  • He he! Mark, you made me actually Lol!

    Don't be sad ๐Ÿ™‚

  • The funny thing is that I sent that email anyway.

    Let's see if THEY pick up on it.

    They are all too familiar with my rants against null, and they are unlikely to be newsletter subscribers, so this may be good.

    Thanks.

    -- Mark Kamoski

  • Damn you Steve! I was just about to post a rant about how I didn't agree, what a bad idea that was and what about ANSI standards.

    Chris.

    Chris.

  • I'm a sucker. I'm sitting here thinking about implications, wanting to take notes, getting ready to post questions to boards... I gotta remember the date when I read these things.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Nice one, Steve! Ok, I have to admit you fooled me.

    -- Gianluca Sartori

  • You know what they say - "No Nulls is good Nulls".

    Or, something like that...

    ___________________________________________________
    โ€œPoliticians are like diapers. They both need changing regularly and for the same reason.โ€

  • Ah Steve,

    You had to spoil the joke with a disclaimer.

    Of course, this is also an April Fool's joke and is in no way based on reality. It's entirely a work of fiction, and I hope you have a smile on your face at this point.

    The joke would've been more effective without.

Viewing 15 posts - 16 through 30 (of 105 total)

You must be logged in to reply to this topic. Login to reply