• Mighty (10/13/2010)


    My opinion is that none of the answers is correct.

    SQL Server will return 2.50 and 3.60, not 2.5 and 3.6.

    Wrong!

    SQL Server will return a result set that consists of two columns (both datatype numeric(3,2)), and one row. The values in this row are 2.5 and 3.6. (Or 2.50 and 23.60, or 0002.500000 and 03.6000 - those are all different representations of the same numeric value).

    It is your client software that converts this to a character representation so that you can see it on your screen. The client software chooses to represent these values with one trailing zero.

    (To check this, open an access project, create a pass-through query to execute this query on SQL Server, and heck the results. They'll show as 2.5 and 3.6. Or in my case as 2,5 and 3,6, since I have a Dutch version of Access, and the Dutch, like many other Europeans, use a decimal comma rather than a decimal point)


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/