I was reading http://msdn.microsoft.com/en-us/library/ms173773.aspx. There is a N in the float datatype. But, when I tried to declare N in float in SQL Server 2008, it didn't allow me. Where can I put the value for N? Thanks in advance.
You can use
declare @x float(24) , @y float(53)
See the Note about other values of n
SQL Server treats n as one of two possible values. If 1<=n<=24, n is treated as 24. If 25<=n<=53, n is treated as 53.
real is synonymous with float(24) and float defaults to float(53)
Edit:
Regarding the comments. There is no point!, try the following.
CREATE TABLE FloatTest
(
x float(7),
y float(24),
z float(53)
)
Then refresh the list of tables and open the table designer. You will see SQL Server has just converted the first two columns to real and the last one to float anyway!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With