webrunner (5/4/2010)
If it turns out that the error is only in some clients, does that mean that those of us who got the question wrong by picking 1 can get ROUND(0.5,0) points for it?
Superb. Well done, sir! :laugh:
It definitely is client-specific, but also server-specific :w00t:
Results so far for SELECT ROUND(0.5, 0) for me:
osql client to 2005 server = 1.0 (correct!)
SQLCMD client to 2005 server = .0 (wrong!)
SSMS 2005 to 2005 server = An error occurred while executing batch. Error message is: Arithmetic Overflow.
SSMS 2008 to 2005 server = An error occurred while executing batch. Error message is: Arithmetic Overflow.
osql client to 2008 server = Error 8115: Arithmetic overflow error converting expression to data type numeric.
SQLCMD client to 2008 server = Error 8115: Arithmetic overflow error converting expression to data type numeric.
SSMS 2008 to 2008 server = Error 8115: Arithmetic overflow error converting expression to data type numeric.
Results so far for PRINT ROUND(0.5, 0) for me:
osql to 2005: 1.0 (correct!)
SQLCMD to 2005: 1.0 (correct!)
SSMS 2005 to 2005 server: 1.0 (correct!)
SSMS 2008 to 2005 server: 1.0 (correct!)
osql client to 2008 server = Error 8115: Arithmetic overflow error converting expression to data type numeric.
SQLCMD client to 2008 server = Error 8115: Arithmetic overflow error converting expression to data type numeric.
SSMS 2008 to 2008 server = Error 8115: Arithmetic overflow error converting expression to data type numeric.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi