记录以备忘
语法其实是一致的:

ALTER TABLE 表1
ADD CONSTRAINT 外键名
FOREIGN KEY (表1的列名)
REFERENCES 表2(表2的列名)
ON UPDATE CASCADE
ON DELETE CASCADE;

其中,表1与表2之间是多对一或一对一的关系。
Tags: , , , , ,

Written on 2008/09/09 by Doctor - Reads: 1150 Comments: 0

发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写