数据插入: 列名或所提供值的数目与表定义不匹配。求帮助
CREATE TABLE Employee.DBO.orderdetail20092294
(
Order_no char(6) PRIMARY KEY,
CONSTRAINT Order_no_constraint
CHECK(Order_no LIKE '[A-Z][A-Z][0-9][0-9]'),
Cust_no char(6) NOT NULL,
P_no char(6) NOT NULL,
Order_total int NOT NULL,
Order_date datetime NOT NULL,
CONSTRAINT customer_contr
FOREIGN KEY(Cust_no)
REFERENCES customer(Cust_no)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT person_contr
FOREIGN KEY(P_no)
REFERENCES person(P_no)
ON DELETE CASCADE
ON UPDATE CASCADE
)
INSERT INTO orderdetail20092294
VALUES('CX22','000001','000007','66000','2002-12-04')
错误:消息 213,级别 16,状态 1,第 1 行
插入错误: 列名或所提供值的数目与表定义不匹配。
我又改成
INSERT INTO orderdetail20092294(Order_no,Cust_no,P_no,Order_total,Order_date)
VALUES('CX22','000001','000007','66000','2002-12-04')
又是:消息 207,级别 16,状态 1,第 1 行
列名 'Order_no' 无效。
求解?、
------解决方案--------------------
INSERT INTO orderdetail20092294
VALUES('CX22','000001','000007','66000','2002-12-04')改成
INSERT INTO orderdetail20092294
VALUES('CX22','000001','000007',66000,'2002-12-04')试试看 ?
------解决方案--------------------
------解决方案--------------------
5V5哪里有错 ?