Home

Keebler/Blog

« Playboy Centerfold Mashup
Free .BE Domains And WHOIS Protection (And Rosario Dawson) »

Preventing Division by Zero in SQL Calls (and Megan Fox)

Okay, I know this is uber-geek so no need to mention that in the comments :D But I was searching for an easy way to prevent division by zero in a division operation in a (MS)SQL SELECT statement, and this popped out as a great way to do so. Use at your own risk of also being branded a geek, and being forced into a world of Star Trek collectables ;-)

ISNULL( NULLIF( your_field, 0 ), 1 )

Related Posts

  • Megan Fox can’t keep her mouth closed
  • I’ve seen the damn Megan Fox photos from GQ!
  • Make SkypeOut calls from your iPhone
  • Cross-Domain XmlHttpRequest Calls
  • Free International Calls Right Here (Seriously!)

This entry was posted on Thursday, November 17th, 2005 at 2:35 pm and is filed under Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

7 Responses to “Preventing Division by Zero in SQL Calls (and Megan Fox)”

  1. blog-j says:
    November 17, 2005 at 4:19 pm

    Sexy Sql Tip

    Monsieur Keebler has a quick little post on avoiding divide by zero errors in Sql.
    Coupled with some fairly… warm and fuzzy … imagery of the foxy Megan Fox.
    Have a read (and look) over @ keebler.net

    …

  2. Fuzzzy says:
    November 17, 2005 at 7:01 pm

    I for one welcome our non-divisible-by-zero overlords :)

  3. Jonathan says:
    November 17, 2005 at 10:32 pm

    I hear when you divide by zero, God kills a kitten.

  4. MrHappy says:
    November 17, 2005 at 11:34 pm

    I heard that when you divide by zero the client kills a developer. I, however, have proof against this. You know what I’m talking about.

  5. Jonathan says:
    November 17, 2005 at 11:37 pm

    Bill for another 8 hours? :D

  6. dasd says:
    December 12, 2007 at 4:41 am

    so beatifull

  7. MP says:
    September 14, 2009 at 10:25 am

    DECLARE @x VARCHAR(10)
    SET @x = ”
    SELECT @x/0 –divide-by-zero error
    SELECT ISNULL( NULLIF( @x, 0 ), 1 )/0 –ditto!!!

Leave a Reply

Click here to cancel reply.

  • Blog Home

  • Tags

    90210 alessandra ambrosio animals asp.net audrina patridge battlestar galactica bikini bunny bush C# canada canada election ctv ctvglobemedia development Election Entertainment/Celebrity facebook Gordon Ramsay gorilla gossip girl hayden panettiere iphone last.fm liveblog liveblogging mesh08 muchmusic Music obama palin rachel bilson scribblelive shenae grimes subway telemarketers the hills the killers the office toronto ttc toronto tv us election video yeah yeah yeahs

    WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

  • Recent Posts

    • Kenny (vs. Spenny) livebloggin…
    • Trying to convince @idiotbante…
    • I wonder if the CTV “Save Loca…
    • Just finished dinner which I m…
    • I shouldn’t get as excited abo…
  • Categories

    • Election
    • Entertainment/Celebrity
    • Fake News
    • Featured
    • Funny
    • Keebler/Show
    • Music
    • My Releases
    • On-the-Road
    • RedDot
    • Reviews
    • Science/Technology
    • ScribbleLive
    • Security
    • Software
    • Torrent Live Stats
    • Tweets
    • Uncategorized
    • Web Development
  • Blogroll

    • Kitten-Monkey’s Cell
    • :: kattekylling ::
    • Adam Finley
    • blog-j
    • fuzzz.gaulin.ca
    • Idiot Banter
    • mad.greyarea.com
    • ob.blog
    • PollyPrissyPants
    • RedDot CMS Users Google Group
    • ScribbleLive Official Blog
  • My Sites

    • Flickr2Facebook
    • RedDot CMS
    • ScribbleLive
    • Where are my f(acebook)ing friends?
    • WhyYouShould