foreign key references  除了关联外键,还可以关联 候选键(unique)

需求

table1 中的  status  int  类型 ,表示状态 ,0 未启动 ,1 已启动,2 已完成

table2 中

id int identity(1,1)  primary key ,
  statusType int unique not null  ,
  statusName  nvarchar(20)

table1

create  table table1
  (
  id int identity(1,1) primary key ,
  TB1Row nvarchar(20),
  T1status  int foreign key references dbo.table2(TB2id2)
  )

候选键(unique)的更多相关文章

  1. [LeetCode] Unique Substrings in Wraparound String 封装字符串中的独特子字符串

    Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz" ...

  2. [LeetCode] Minimum Unique Word Abbreviation 最短的独一无二的单词缩写

    A string such as "word" contains the following abbreviations: ["word", "1or ...

  3. [LeetCode] Count Numbers with Unique Digits 计算各位不相同的数字个数

    Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...

  4. [LeetCode] Unique Word Abbreviation 独特的单词缩写

    An abbreviation of a word follows the form <first letter><number><last letter>. Be ...

  5. [LeetCode] Unique Binary Search Trees 独一无二的二叉搜索树

    Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp ...

  6. [LeetCode] Unique Binary Search Trees II 独一无二的二叉搜索树之二

    Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For e ...

  7. [LeetCode] Unique Paths II 不同的路径之二

    Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How m ...

  8. [LeetCode] Unique Paths 不同的路径

    A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The ...

  9. 2 Unique Binary Search Trees II_Leetcode

    Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For e ...

随机推荐

  1. EasyUI禁用控制方法常采用

    EasyUI禁用控制方法常采用: 1.validatebox使用可以使用:前两个适用于个人validatebox;   第三适用于整个form内箱;    <1>.$("#id& ...

  2. 摆弄【Nhibernate 协会制图--导乐陪伴分娩】

    现有两个实体,Dog和 Master,映射到数据库表中如上图所看到的.一个Dog仅仅同意相应一个Master,但一个Master能够有多个Dog.我们在查询Dog的时候.往往还须要知道其主人Maste ...

  3. Android在ListView滑动数据混乱

    我相信做过Android应用程序开发或多或少都遇到了这个问题.或者是在ListView数据损坏幻灯片事件.要么GridView数据损坏幻灯片事件. 让我们来看看一个网友写的文章,个人感觉还不错的文章: ...

  4. SQL Server高可用——日志传送(4-3)——使用

    原文:SQL Server高可用--日志传送(4-3)--使用 顺接上一篇:SQL Server高可用--日志传送(4-2)--部署 本文为本系列最重要的一篇,讲述如何使用日志传送及一些注意事项.从上 ...

  5. 数据你把它的金额-JAVA分页

    数据量你造吗-JAVA分页 原创地址:   http://www.cnblogs.com/Alandre/  (泥沙砖瓦浆木匠),须要转载的,保留下! Thanks 学习的心态第一,解行要对应. 事实 ...

  6. 建立ORACLE10G DATA GUARD---&gt;Physical Standby

    下面是我自己建Physical Standby,按照下面的步骤一步我一步,当然,打造成功,以下步骤可以作为建筑物Data Guard结构操作手册. HA和DG差额:HA:可以做IP切换自己主动  DG ...

  7. C++ 堆 和 堆 分析

    [摘要] 堆和栈,即是数据结构,又是分配存储空间的不同方式.在数据结构上.堆是树型层次结构,结点按keyword次序排列,经常使用的堆为二叉堆:栈是一种先进后出的数据结构.在内存分配上的堆和栈,首要差 ...

  8. 设备11g_rac配置对等

    linux平台安装oracle 11gssh同等配置简单 构造grid用户任关系 登陸rac1,rac2分别运行: $ su - grid $mkdir ~/.ssh $chmod 700 ~/.ss ...

  9. AFNetworking框架_上传文件或图像server

    的文本 XXXXXXXXXX在自己的论点更填写 - (void)uploadImageWithImage:(NSString *)imagePath { //上传其它所需參数 NSString *us ...

  10. sql server 2008如何导入mdf,ldf文件

    sql server 2008怎样导入mdf,ldf文件   网上找了非常多解决sql server导入其它电脑拷过来的mdf文件,多数是不全.遇到的解决方法不一样等问题,下边是找到的解决这个问题的最 ...