开发者

SQL Server 2008 cannot define decimal type with 4 decimal places?

I am using SQL Server 2008 express, any reason?? however, if i convert to decimal(6,4) i开发者_如何学Gos work. e.g. Select CONVERT(decimal(6,4),'1.1234'); thanks you.

SQL Server 2008 cannot define decimal type with 4 decimal places?


decimal(x,y)

x: total number of digits(max)
y: number of digits after decimal point(max)

thats why y<=x


decimal(Precision, Scale). The Precision number control the maximum number of digits on the left side of the period. The Scale specifies the maximum number of digits on the right side.

If you want 3 digits before decimal and 4 after decimal then

rate    decimal(7, 4)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜