数据类型为tinyint的SQL算术溢出错误,值= 300

时间:2021-09-17 01:56:25

I'm really new in Microsoft SQL Server, I'm trying to update the value of a column to null. But it gives 'Arithmetic overflow error for data type tinyint, value = 300.' In the table design, this column's datatype is tinyint(allow nulls is clicked). Please help!

我是Microsoft SQL Server的新手,我正在尝试将列的值更新为null。但它给出了'数据类型tinyint的算术溢出错误,值= 300。'在表设计中,此列的数据类型为tinyint(单击允许空值)。请帮忙!

Update tblMedicationOrder set MedicationID = Null

更新tblMedicationOrder设置MedicationID = Null

1 个解决方案

#1


1  

There is not an error in the your code.. You should make sure that set null value.

您的代码中没有错误。您应该确保设置null值。

Tinyint range = 0 to 255

Tinyint范围= 0到255

If you enter a value greater than 255, it gives this error.

如果输入的值大于255,则会出现此错误。

Arithmetic overflow error for data type tinyint, value = 300.

数据类型tinyint的算术溢出错误,值= 300。

#1


1  

There is not an error in the your code.. You should make sure that set null value.

您的代码中没有错误。您应该确保设置null值。

Tinyint range = 0 to 255

Tinyint范围= 0到255

If you enter a value greater than 255, it gives this error.

如果输入的值大于255,则会出现此错误。

Arithmetic overflow error for data type tinyint, value = 300.

数据类型tinyint的算术溢出错误,值= 300。