一道英文考试题,alter table
alter table Customer ADD (FaxNumber Varchar(12) not null)
Explain why the following sql command will be rejected by the DBMS, and say how the required effect can be achieved:
这个是说该sql指令会被DBMS拒绝, 可是我用access没有被拒绝阿,
这个是什么情况?
db2可以通过这个指令吗?
[解决办法]
如果原来的数据库中有数据,肯定是要被 reject 的,因为你在 FaxNumber 要求是 NOT NULL 。
你只能先 alter table Customer ADD (FaxNumber Varchar(12)) 。然后将源数据库中的所有数据在 FaxNumber 上添上值 后 在 alert 为 NOT NULL
[解决办法]
楼上正解,问题应该出在这个 NOT NULL 上,加个DEFAULT或者去掉这个NOT NULL
[解决办法]
alter table Customer ADD (FaxNumber Varchar(12) not null)
加一列 not null的值 但是值是什么呢
[解决办法]