简体   繁体   中英

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) is work. eg Select CONVERT(decimal(6,4),'1.1234'); thanks you.

替代文字

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM