外键 Foreign keys
Create a foreign key relationship in Table Designer
Create a foreign key relationship in Table Designer
Using SQL Server Management Studio
In Object Explorer, right-click the table that will be on the foreign-key side of the relationship and click Design.
The table opens in Table Designer.
From the Table Designer menu, click Relationships. 这里需要先右键选中column,然后才会有menu
In the Foreign-key Relationships dialog box, click Add.
The relationship appears in the Selected Relationship list with a system-provided name in the format FK_<tablename>_<tablename>, where tablename is the name of the foreign key table.
Click the relationship in the Selected Relationship list.
Click Tables and Columns Specification in the grid to the right and click the ellipses (...) to the right of the property.
In the Tables and Columns dialog box, in the Primary Key drop-down list, choose the table that will be on the primary-key side of the relationship.
In the grid beneath, choose the columns contributing to the table's primary key. In the adjacent grid cell to the left of each column, choose the corresponding foreign-key column of the foreign-key table.
Table Designer suggests a name for the relationship. To change this name, edit the contents of the Relationship Name text box.
Choose OK to create the relationship.



外键 Foreign keys的更多相关文章
- Oracle外键(Foreign Key)使用详细的说明(一)
Oracle外键(Foreign Key)使用详细的说明(一) 1.目标 演示如何Oracle使用外键数据库 2.什么是外键? 1)在Oracle数据库中,外键是用来实现參照完整性的方法之中的一个.打 ...
- 数据库六大约束用法:主键(primary key)、外键(foreign key)、非空(not null)、默认(default)、检查(check)、唯一(unique)
1. 数据库有六大约束 主键(primary key) 外键(foreign key):被参照的键必须有唯一约束或是主键 非空(not null) 默认(default) 检查(check):orac ...
- MYSQL外键(Foreign Key)的使用
在MySQL 3.23.44版本后,InnoDB引擎类型的表支持了外键约束.外键的使用条件:1.两个表必须是InnoDB表,MyISAM表暂时不支持外键(据说以后的版本有可能支持,但至少目前不支持): ...
- MySQL建立外键(Foreign Key)
如果在最初建立表的时候就建立外键这样一般不会有什么问题,顺便说一下建立外键的时候,需要注意的地方. cascade方式在父表上update/delete记录时,同步update/delete掉子表的匹 ...
- 组合外键(FOREIGN KEY)
一张表,它的外键即是参考另一张表的主键,但这些关联键是组合键,由2列或多列组成. 你可以先看看这篇<多列组合为主键(PRIMARY KEY)>https://www.cnblogs.com ...
- 外键(foreign key)的使用及其优缺点
如果公共关键字在一个关系中是主关键字,那么这个公共关键字被称为另一个关系的外键.由此可见,外键表示了两个关系之间的相关联系.以另一个关系的外键作主关键字的表被称为主表,具有此外键的表被称为主表的从表. ...
- 外键约束:foreign key
*外键 foreign key* 1.概念:如果一个实体的(student)的某个字段,指向(引用)另个实体(class)的主键 (class:class_id),就称为student实体的class ...
- PowerDesigner 12小技巧-pd小技巧-pd工具栏不见了-pd修改外键命名规则-pd添加外键
PowerDesigner 12小技巧-pd小技巧-pd工具栏不见了-pd修改外键命名规则-pd添加外键 1. 附加:工具栏不见了 调色板(Palette)快捷工具栏不见了PowerDesigner ...
- mysql 外键 级联
主表 -- 创建用户信息表 create table userinfo ( userid int primary key not null auto_increment COMMENT '主键', u ...
随机推荐
- uvm设计分析——field automation
uvm中的field_automation主要实现了class中的基础元素的copy,compare等函数, 实现方式分为两种:1)用户注册,field系列宏:uvm内部调用static status ...
- windows启动项管理
在运行框中输入 msconfig 选择启动栏 会跳转到任务管理器,可以管理启动项,可以看到我的启动项里有nc病毒 ,点击禁用即可.
- VM虚拟机配置固定IP
linux下vmware桥接模式.静态ip上外网的配置 http://blog.csdn.net/zdh_139/article/details/73456654 虚拟机网络改成桥接模式 vi /et ...
- Vue系列之 => 自定义键盘修饰符
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Linux QtCreator 编译报错:No rule to make target '.../***' needed by '***.o'.stop
Linux QtCreator 编译报错:No rule to make target 'mainwindow.cpp' needed by 'mainwindow.o'.stop [1]解决方案 ...
- JS实战
1. jquery取消点击事件 $("#dashboard").unbind("click"); 2.jquery绑定鼠标滑过,离开事件 $("#da ...
- sublime text3 快捷键和好用的插件
常用快捷键: Ctrl + D 选中一个单词 Ctrl + L 选中一行 Ctrl + A 全选 Ctrl + M 选中括号内所有内容 (编写CSS或JS时非常实用) Ctrl + G 快速定位到某一 ...
- bootsrtap h5 移动版页面 在苹果手机ios滑动上下拉动滚动卡顿问题解决方法
bootsrtap h5 移动版页面 在苹果手机ios滑动上下拉动滚动卡顿问题解决方法 bootsrtap框架做的h5页面,在android手机下没有卡顿问题,在苹果手机就一直存在这问题,开始毫无头绪 ...
- 读QT5.7源码(三)Q_OBJECT 和QMetaObject
Qt meta-object系统基于三个方面: 1.QObject提供一个基类,方便派生类使用meta-object系统的功能: 2.Q_OBJECT宏,在类的声明体内激活meta-object功 ...
- BUAA 111 圆有点挤
题目描述 gg最近想给女友送两个精美的小礼品:两个底面半径分别为R1和R2的圆柱形宝石,并想装在一个盒子里送给女友. 好不容易找到了一个长方体的盒子,其底面为A*B的矩形,他感觉好像宝石装不进去,但又 ...