Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CEIL function

Author  Topic 

mmkrishna1919
Yak Posting Veteran

95 Posts

Posted - 2013-07-09 : 07:24:16
Hi Team,

The statement from MSDN about CEIL function:

"Arguments:
numeric_expression
Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type."

http://msdn.microsoft.com/en-us/library/ms189818(v=sql.100).aspx

If i use bit data type variable or expression inside ceil it is returning output without any error.

why the arguemnt data type except BIT data type.

Thanks..

M.MURALI kRISHNA

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-07-09 : 08:14:15
It implicitly converts the bit to floating point. The return type is the same as the input type, so you can see that it is being converted to float if you run this:
DECLARE @n BIT = 1;
SELECT SQL_VARIANT_PROPERTY(CEILING(@n),'basetype');
Go to Top of Page
   

- Advertisement -