0
CREATE TABLE posEmployees
(
ID int IDENTITY(1,1) PRIMARY KEY,
LName varchar(55) NOT NULL,
FName varchar(55),
Dept varchar(20),
HourlyPay numeric(10, 2),
WeeklyHours numeric(5, 2),
IsManager bit, 
Salary numeric(9,2), 
HireFire bit
)

select * from POS_EMPLOYEES

 insert into POS_EMPLOYEES (LName, FName, Dept, HourlyPay, WeeklyHours)
values ('Pride', 'Kitty', 'Sales', 5.5, 20.0)

无论我采用哪种方式(数字或十进制),或者是否填写所有字段,我都会收到此错误:

将数字转换为数字数据类型的算术溢出错误。

4

1 回答 1

1

您的表名与插入和选择查询不同,我很困惑为什么您也要执行选择语句,但试试这个:

CREATE TABLE posEmployees
(
ID int IDENTITY(1,1) PRIMARY KEY,
LName varchar(55) NOT NULL,
FName varchar(55),
Dept varchar(20),
HourlyPay numeric(10, 2),
WeeklyHours numeric(5, 2),
IsManager bit, 
Salary numeric(9,2), 
HireFire bit
)

 insert into posEmployees(LName, FName, Dept, HourlyPay, WeeklyHours)
values ('Pride', 'Kitty', 'Sales', 5.5, 20.0)
于 2013-10-24T21:45:57.067 回答