get real!

  • VM-723206

    SSCrazy

    Points: 2964

    Comments posted to this topic are about the item get real!

  • steve.saunders-611242

    SSC Enthusiast

    Points: 106

    real is actually a synonym for float(24) which has a precision of only 7 digits.

  • cengland0

    SSCertifiable

    Points: 6102

    SQL 2005 actually displays the answer as 1234567936. I tested this to make sure. The scientific notation might only be displayed depending on your local configuration options.

  • OCTom

    SSChampion

    Points: 11755

    In my environment, SQL 2005 & SQL 2008 display it the same way as the correct answer.

  • cengland0

    SSCertifiable

    Points: 6102

    Suppose it depends on which query tool you use. If you use the one built into Microsoft SQL Server Management Studio, it does display in scientific notation.

    SQLDBX displays as 1234567936

    It's probably SQLDBX that is translating it back into a non-scientific notation number.

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 718163

    The questions are almost always built on the native tools unless noted.

    your client tool will indeed translate things.

  • Jeff Moden

    SSC Guru

    Points: 996119

    At least the correct answer wasn't "close" to all the other answers because none of the answers are correct in 2k.

    1.2345679E+9

    Before you start beating the "latest version" drum on that... I can't put my hands on the URL but I remember seeing a recent poll where 67% of all data centers that took part in the survey still had at least 1 server running SQL Server 2000.

    With that in mind, I believe that it's still worthwhile listing what version of SQL Server the question is for.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • SQLWinther

    SSCertifiable

    Points: 5886

    steve.saunders (6/26/2009)


    real is actually a synonym for float(24) which has a precision of only 7 digits.

    You are right! Real and float(24) only has a precision of 7 seven digits. The answer is correct but the explanation is a little bit misleading. At least if MS is following the ISO standard 😀

    The ISO synonym for real is float(24).

    http://msdn.microsoft.com/en-us/library/ms173773.aspx

    /Håkan Winther

    /Håkan Winther
    MCITP:Database Developer 2008
    MCTS: SQL Server 2008, Implementation and Maintenance
    MCSE: Data Platform

  • SanjayAttray

    SSChampion

    Points: 13157

    in SQL server 2005 result is 1.234568E+09

    while in SQL 2000 result is 1.2345679E+9

    Does it make any difference ?

    SQL DBA.

  • Jeff Moden

    SSC Guru

    Points: 996119

    SanjayAttray (6/29/2009)


    in SQL server 2005 result is 1.234568E+09

    while in SQL 2000 result is 1.2345679E+9

    Does it make any difference ?

    Heh... only if you're answering a QOD and only if both answers are available in the multiple guess section.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • David Burrows

    SSC Guru

    Points: 64693

    SanjayAttray (6/29/2009)


    in SQL server 2005 result is 1.234568E+09

    while in SQL 2000 result is 1.2345679E+9

    Does it make any difference ?

    It is dependant on the client tool

    QA shows 1.2345679E+9 SQL2000 & SQL2005

    SSMS shows 1.234568E+09 SQL2000 & SQL2005

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 11 posts - 1 through 11 (of 11 total)

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