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. 让你提前知道软件开发(24):C语言和主要特征的历史

    文章1部分 再次了解C语言 C语言的发展历史和主要特点 作为一门众所周知的计算机编程语言,C语言是谁发明的呢?它是怎样演进的?它有何特点?究竟有多少人在使用它? 1. C语言之父 C语言是1972年由 ...

  2. cocos2d-x v3.2环境配置(现在3.x版本号可以配置该)

     这里介绍的是Windows环境下的cocos2d-x配置. 前提: •Windows 7+ •cocos2d-x v3.2版本号(能够在http://www.cocos2d-x.org/down ...

  3. java.lang.VerifyError

    public class VerifyErrorextends LinkageError Thrown when the "verifier" detects that a cla ...

  4. POJ1251 Jungle Roads 【最小生成树Prim】

    Jungle Roads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19536   Accepted: 8970 Des ...

  5. cocos2d-x删除本地存储的文件UserDefault.xml方法——白费

    许多其他的精彩分享:http://blog.csdn.net/u010229677 首先获取UserDefault的存储位置.然后remove就可以: remove( UserDefault::get ...

  6. Android决议具体解释

    1.Android手机常见的分辨率 WVGA:800x480 FWVGA:854x480 QHD:960x540 720P:1280x720(SD.standard definition,SD) 10 ...

  7. HDU 1176 免费馅饼(DP)

    职务地址:HDU 1176 以时间为横轴.11个点位纵轴构造一个矩阵.然后利用数字三角形的方法从上往下递推下去. 代码例如以下: #include <iostream> #include ...

  8. codeforces Round #259(div2) E解决报告

    E. Little Pony and Summer Sun Celebration time limit per test 1 second memory limit per test 256 meg ...

  9. 数组名取地址所算数运算应注意的&quot;trap&quot;

    数组名取地址所算数运算应注意的"trap" 直接看代码: #include <stdio.h> int main() { int array[5]; printf(&q ...

  10. Content://sms

    package com.example.sms; import android.app.Activity; import android.app.Notification; import androi ...