日期:2014-05-19  浏览次数:20458 次

在mssql2000中利用向导怎么创建外键??
mssql2000数据库

有两个表Product_Info和Product_Supply
Product_Info有Product_ID,Product_Name,Product_Price,Product_Unit字段,
Product_Supply有Product_ID,Product_Supply_Name,Product_Quantity字段
其中Product_Info表中Product_ID是主键,是表Product_Supply的外键
利用向导怎么设置?????


------解决方案--------------------
在关系图中建立
------解决方案--------------------
右键表,修改,然后上面的工具栏中有一项叫关系图,进那里面设置外键
------解决方案--------------------
CREATE TABLE banlist (
banlist_id INT NOT NULL auto_increment,
user_id INT NOT NULL default '0 ',
banlist_ip varchar(8) NOT NULL default ' ',
banlist_email varchar(255) default NULL,
PRIMARY KEY (banlist_id),
INDEX idx_user (user_id)
) TYPE=InnoDB;--使用外键