• Paul White NZ (5/4/2010)


    Hugo Kornelis (5/4/2010)


    Here is another repro that runs fine on all clients, to demonstrate that SQL Server itself actually does not have any issues with this code:

    -- Or, the more direct approach

    SELECT CAST(ROUND(0.5,0) AS decimal(12,2));

    According to Jim Hogg (MSFT) on Connect, the error is raised by SQL Server, and is By Design:

    https://connect.microsoft.com/SQLServer/feedback/details/364387/using-round-function-with-passing-numeric-expression-to-9-5-and-length-0

    I don't think that this explanation is 100% correct, as we had already found out that the error is raised within the Client, not SQL Server (at least thats what I think)

    This all still does not make too much sense to me, especially after you gave the hint regarding SQLCMD returning 0. Did not see that in the first place.

    And thanks for your nice comment as well. Feels really good to get such positive feedback from real experts:-)

    Best Regards,

    Chris Büttner