我寫一段代碼來填充一個表,它不工作,它不停地發送錯誤信息像Error converting data type varchar to numeric.
這裏是MSSQL創建表,這裏是插入語句錯誤插入值
create table employee_pay_tbl
(
EMP_ID varchar(9) NOT NULL primary key,
position VARCHAR(15) not null ,
date_hire date,
pay_rate decimal (4,2),
date_last_raise date,
salary decimal (8,2),
bonus decimal (6,2),
constraint EMP_FK FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE_TBL(EMP_ID)
);
這是不工作
INSERT INTO employee_pay_tbl
VALUES ('442346889','TEAM LEADER','2000-06-17','14.75','2009-06-01','NULL','NULL');
insert語句我試圖找出使用這段代碼錯誤的值
SELECT * FROM employee_pay_tbl WHERE isnumeric(bonus) = 0 AND bonus IS NOT null;
我認爲日期值導致錯誤。我怎樣才能解決這個問題?