http://hi.baidu.com/shanghaocool/blog/item/1d014b0bf4afdc89d1581bbc.html
添加外键
alter table sitecodes drop foreign key FK_sitecodes
设置外键
alter table 需要建立外键的表 add constraint 外键名字 foreign key references 外键表(外键字段) ,alter table sitecodes add constraint FK_sitecodes foreign key (LocationID) references
location(LocationID)