1
当“关键字‘改变’附近的语法不正确”我有这些表:添加外键约束
Employee(Ename, SSN, Bdate, Address, Dnumber)
Department (Dname,Dno,Dmgr_SSN(
Project(Pname, Pnumber, Plocation, Dnum)
WorksON(SSN,Pnumber,Hours)
当我尝试使用ALTER
:
alter table Employee
add foreign key (Dnumber)
REFERENCES Department (Dno);
我得到这个错误:
Msg 156, Level 15, State 1, Line 24
Incorrect syntax near the keyword 'alter'.
注意:我根据表查询的定义写了这个查询
你看了[文件](http://msdn.microsoft.com/en-us/library/ms190273 .aspx),包括例子? – Pondlife 2013-04-11 02:41:02
只是问明显。你是否执行了“创建表”和“更改表”? – Gayu 2013-04-11 03:00:46