There's a Lot to Learn From Even Simple Puzzles

  • rja.carnegie (8/12/2009)


    A previous exercise elsewhere, which I think was about testing for primes in the fewest characters of script, was where I learned you can use @ as a variable name (and # as a temporary table name). That you almost always shouldn't is probably pretty clear!

    And using @ as a variable and # as a tempoary table has been depreciated. Not sure if it is legal in SQL Server 2008, but pretty sure it won't be after SQL Server 2008.

  • DECLARE@ INT = 1

    SELECT@ AS [INT],

    @@VERSION AS [@@VERSION]

    INT @@VERSION

    ----------- ------------------------------------------------------------------------

    1 Microsoft SQL Server 2008 R2 (CTP) - 10.50.1092.20 (X64)

    Jul 22 2009 21:22:48

    Copyright (c) Microsoft Corporation

    Enterprise Evaluation Edition (64-bit) on Windows NT 6.1 (Build 7600: )


    N 56°04'39.16"
    E 12°55'05.25"

  • Anyone can do th@. "create table [ ] (rja_carnegie@excite_dot_com int)" 😛 (on 2005)

    I "depreciated" it myself, but if you're confident that a script only needs one variable or table and it won't go further, why not? (Well, if it's deprecated. I suppose this time it really is?)

    Surely there isn't a huge problem of no-name variable and table abuse, or I'd have heard about it sooner!

  • Phil Factor (8/11/2009)


    Well done to all the contestants; even the solution that I killed after it had taken 17 hours to calculate primes below 1000. It was fun to judge.

    For the first 4000 years of human history, 17 hours would probably be an acceptable time. Kids these days... 🙂

    Anyway, thanks Phil and Joe, this was a great contest. Even though I spent way too much time on it, I learned a bit and remembered a bit and had the humbling "joy" of revisiting old code and old projects, as well.

    Congrats, Barry.

Viewing 4 posts - 16 through 18 (of 18 total)

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