• monkeyPushButton (unregistered)

    I want to make a comment, but I got nothing.

  • (cs)

    select '' [comment]

  • Sam (unregistered)

    I can see the point of this. Who knows when you might need to change the type of Nothing system-wide.

  • (cs)

    Once a great philosopher said:

    You know, you come from nothing, you're going back to nothing. What have you lost? Nothing!

  • BBT (unregistered)

    My eyes, the goggles do nothing!

  • ​‌ ‌‌‌   (unregistered)

    ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  

  • Mike Caron (unregistered)

    This is what they call "having something for Nothing"!

  • manRo (unregistered)

    Love it! Must be the database connection of the Nada software. :)

  • Nibh (unregistered)

    TRWTF is that in oracle, '' is actually equivalent to null.

  • Nihil (unregistered)

    What's worse, if this is MS SQL Server, the engine treats that as a system stored proc and may spend additional time doing a lookup for it. So not only does it do nothing, it wastes even more CPU cycles than one might think.

    captcha: ideo: It's not quite an idea, but sort of a bad thought.

  • SR (unregistered)

    You get nothing for nothing, if that's what you do...

  • Anonymous (unregistered)

    Soft coding the value of nothing is obviously to aid future maintenance. 'Nothing' is an entirely subjective quantity depending on your field of expertise (I'm looking at you, quantum physicists).

  • Jumble (unregistered) in reply to ​‌ ‌‌‌  
    ​‌ ‌‌‌  :
    ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  

    I get scared that this might be a whitespace program.

  • Rasmus Toftdahl Olesen (unregistered)

    "Money for nothing and chicks for free", i think the old coder had it figured out.

  • Nick (unregistered)

    They probably had a meeting at some point at which the developer said "Nothing could possibly solve this problem!"

  • @Deprecated (unregistered) in reply to Rasmus Toftdahl Olesen
    Rasmus Toftdahl Olesen:
    "Money for nothing and chicks for free", i think the old coder had it figured out.

    Then the real WTF is there are no comments.

    CREATE PROCEDURE [sp_getNothing] AS

    select '' as Nothing -- Bring on the chicks END

  • (cs)

    TRWFT is the lack of sp_setNothing

  • (cs)

    More stored procedures you call the cooler you are. Ok?

  • SR (unregistered) in reply to Airhead
    Airhead:
    More stored procedures you call the cooler you are. Ok?

    Sure, just don't ever work on my team. OK?

  • (cs)

    Obviously some overzealous senior architect required that all data access routines use stored procedures-- even when the result is "return null".

  • (cs)

    I would love to see a code snippet where this procedure gets called

  • grizz (unregistered) in reply to Rasmus Toftdahl Olesen
    Rasmus Toftdahl Olesen:
    "Money for nothing and chicks for free", i think the old coder had it figured out.

    Nah, I think that would have to be a different SP, something like this:

    CREATE PROCEDURE sp_Dire AS select cast('' as money) as nothing,'' as chicks END

  • (cs) in reply to Vitrix
    Once a great philosopher said:

    You know, you come from nothing, you're going back to nothing. What have you lost? Nothing!

    Cheer up Brian, worse things happen at sea!

  • grizz (unregistered) in reply to grizz

    Oops; didn't read the "spec" properly. Should be

    CREATE PROCEDURE sp_Nothing AS select cast('' as money) as nothing,'chicks' as free END

  • arms (unregistered) in reply to Vitrix
    Vitrix:
    Once a great philosopher said:

    You know, you come from nothing, you're going back to nothing. What have you lost? Nothing!

    Eric Idle?

  • (cs) in reply to SR
    SR:
    Airhead:
    More stored procedures you call the cooler you are. Ok?

    Sure, just don't ever work on my team. OK?

    Come on! I can let you use some of my cool stored procedures!

  • Chezmondo (unregistered)

    System.out.println("Hello World!");

    Actually, scrub that.

    System.out.println("");

    Fixed.

  • (cs)

    Ah, yes, I see the problem. It should have been implemented as a UDF instead of a Stored Procedure; the way it's done now, the result has to be selected into a temporary table. A UDF version could be used with SELECT and WHERE statements for queries that depend heavily on nothing.

  • JohnMcG (unregistered)

    You'll get nothing and like it!

  • Megatron (unregistered)

    "The only true wisdom consists in knowing that you know nothing"

    "Dear subconscious this is an important message, give me all your monies and chicks"

    ""

  • Some guy (unregistered) in reply to Megatron
    Megatron:
    "The only true wisdom consists in knowing that you know nothing"

    "Dear subconscious this is an important message, give me all your monies and chicks"

    ""

    Where can I get some damn bait?

  • (cs) in reply to Rasmus Toftdahl Olesen
    Rasmus Toftdahl Olesen:
    "Money for nothing and chicks for free", i think the old coder had it figured out.

    This is the result of getting paid per line of code. He got money for Nothing.

  • Bruce W (unregistered)

    "You get NOTHING! You lose! Good day, sir." Gene Wilder as Willie Wonka.

  • Robert Claypool (unregistered)

    Clearly this is a placeholder for where features would potentially be added later or where it had been removed but the surviving code still needed an answer.

  • (cs)

    This stored proc solves a problem I've had for the past 7 months! TY TDWTF!

  • Selis (unregistered) in reply to Nihil

    Not completely true.

    In 2008 the user database is searched before master is so there is no performance penalty by using an "sp" prefix ... although, in my opinion, it's good practice not to.

    Cheers!

  • Anonymously Yours (unregistered) in reply to campkev
    campkev:
    I would love to see a code snippet where this procedure gets called
    //Management bastards keep saying we do nothing all day, huh?
    function optimizeEmployability()
    {
        //Speed-up loop
        for(i = 0; i < 10000000; $i++)
        {
            mssql_query('exec sp_getNothing');
        }
    }
    
  • (cs)

    Where's the WTF?

    this specific stored procedure was used 13 times within the application.

    How?

  • (cs) in reply to grizz
    grizz:
    Rasmus Toftdahl Olesen:
    "Money for nothing and chicks for free", i think the old coder had it figured out.

    Nah, I think that would have to be a different SP, something like this:

    CREATE PROCEDURE sp_Dire AS select cast('' as money) as nothing,'' as chicks END

    Don't you mean

    CREATE PROCEDURE sp_Awesome AS
        SELECT CAST('' AS MONEY) AS [Nothing], 'Eliza Dushku, Scarlett Johansen' AS [Chicks]
    END
    
    ?
    
  • rancorous (unregistered)

    It was an app to support a CEO's staff meeting? Seems like this would be a function that would be used often...

  • (cs) in reply to campkev
    campkev:
    I would love to see a code snippet where this procedure gets called
    .
    .
    .
    something = !sp_getNothing();
    .
    .
    .
    
  • Patrick (unregistered)

    Possible usage of sp_getNothing:

    parameters.Add("UserID", UserID);

    switch(whatToGet){ case GetThis.UserID: spname="sp_getNothing"; break; case GetThis.Name: spname="sp_getName"; break; case GetThis.DOB: spname="sp_getDOB"; break; case GetThis.FileID: spname="sp_getFileID"; break; default: spname="sp_getNothing"; break; }

    comm.CommandText=spname;

    etc...

    This is still bad practice.

  • Patrick (unregistered) in reply to Jumble
    Jumble:
    ​‌ ‌‌‌  :
    ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  

    I get scared that this might be a whitespace program.

    don't run it, it's "rm -rf /"

  • h (unregistered)

    There's nothing good unless you do it yourself.

  • RBoy (unregistered)

    So, the programmer that wrote this got paid for doing nothing.

    Or that he was good for nothing.

    I'm not sure, but sp_getNothing facillisis both situations.

  • Dr. Goodnight (unregistered) in reply to Nibh
    Nibh:
    TRWTF is that in oracle, '' is actually equivalent to null.

    You wouldn't happen to have identified that this is the way Oracle works by using SAS SQL/Connect would you?

  • usitas (unregistered) in reply to Patrick
    Patrick:
    Jumble:
    ​‌ ‌‌‌  :
    ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌  ​‌ ‌‌‌   ​‌ ‌‌‌  ​‌ ‌‌‌  

    I get scared that this might be a whitespace program.

    don't run it, it's "rm -rf /"

    what does that do, and how do I run it? I'm feeling dangerous...

  • Dr. Goodnight (unregistered) in reply to toth
    toth:
    grizz:
    Rasmus Toftdahl Olesen:
    "Money for nothing and chicks for free", i think the old coder had it figured out.

    Nah, I think that would have to be a different SP, something like this:

    CREATE PROCEDURE sp_Dire AS select cast('' as money) as nothing,'' as chicks END

    Don't you mean

    CREATE PROCEDURE sp_Awesome AS
        SELECT CAST('' AS MONEY) AS [Nothing], 'Eliza Dushku, Scarlett Johansen' AS [Chicks]
    END
    
    ?
    
    /usr/bin/perl -e 'for $nothing (@money) { for $free (@chicks) { }}'
    

    Hey, this is fun.

  • bill (unregistered) in reply to campkev

    ditto

  • bill (unregistered) in reply to campkev

    ditto

Leave a comment on “sp_getNothing”

Log In or post as a guest

Replying to comment #:

« Return to Article