外键 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 ...
随机推荐
- HTTP方法之GET与POST对比
超文本传输协议(HTTP)的设计目的是保证客户端与服务器之间的通信.最常用的是GET与POST 1.GET方法: 查询字符串(键/值对)是在GET请求的URL中发送的. /test.php?a=val ...
- 转自大神的KM想法
我第一次理解KM算法看到大神的讲解不胜感激这km挺神奇的接下来就见识一下这个大牛的吧 转自 http://blog.csdn.net/wuxinxiaohuangdou/article/details ...
- 转:异常处理之ThreadException、unhandledException及多线程异常处理
转载自:http://www.cnblogs.com/levin9/articles/2319251.html 一:ThreadException和unhandledException的区别 处理未捕 ...
- JS实现document.ready
通常我们想要在页面内容加载完成后运行 JS 时,都会使用 window.onload 来处理,比如: window.onload = function(){ alert('Hello World!') ...
- arcgis desktop 地理编码服务发布
1.创建地址定位器 2.创建复合地址定位器 3.鼠标右键,共享为,地理编码服务.
- [转载] Web Service工作原理及实例
一.Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求, ...
- .NET创建一个即是可执行程序又是Windows服务的程序
不得不说,.NET中安装服务很麻烦,即要创建Service,又要创建ServiceInstall,最后还要弄一堆命令来安装和卸载. 今天给大家提供一种方式,直接使用我们的程序来安装/卸载服务,并且可以 ...
- Java 高级开发必修知识---内部类
摘自:http://www.cnblogs.com/lsy131479/p/8798912.html Java 内部类分为: 1)成员内部类 2)静态嵌套类 3)方法内部类 4)匿名内部类 内部类的共 ...
- 像黑客一样使用Linux命令行(转载)
阅读目录 前言 使用 tmux 复用控制台窗口 在命令行中快速移动光标 在命令行中快速删除文本 快速查看和搜索历史命令 快速引用和修饰历史命令 录制屏幕并转换为 gif 动画图片 总结 回到顶部 前言 ...
- The Little Prince-12/03
The Little Prince-12/03 These days, I am always busy with my things, including experiment and others ...