Coding Magic Values

  • Comments posted to this topic are about the item Coding Magic Values

  • I wonder why it's called a 'variable'.

    Disaster Recovery = Backup ( Backup ( Your Backup ) )

  • Hello!

    I think that since we are in 2023 and the text references 2022, it will be better to use a variable in the text to read the year from the system and avoid the confusion.

    Enjoying the content of SSC since a while...


    José Cano

  • Lol, not sure that's the place for a variable. Silly me still in the habit of typing 2022.

    It's fixed.

  • A useful feature would be declaration of user defined global constants at the server or database level.

    For example:

    DECLARE CONST @@PI NUMERIC(12,10) = 3.1415926535;
    DECLARE CONST @@StatusInProcess TINYINT = 2;
    DECLARE CONST @@StatusDelivered TINYINT = 3;
    DECLARE CONST @@GB BIGINT = 1073741824;

    You can kind of do this using scalar functions, but that can potentially have adverse effects on query execution plans.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

Viewing 5 posts - 1 through 4 (of 4 total)

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