SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CEIL function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mmkrishna1919
Yak Posting Veteran

India
94 Posts

Posted - 07/09/2013 :  07:24:16  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3712 Posts

Posted - 07/09/2013 :  08:14:15  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000