惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
G
Google Developers Blog
腾讯CDC
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
博客园_首页
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

博客园 - 上海-天浩

ASP.NET WebApi(.Net Framework) 应用CacheManager 软件工程的核心问题并非是编程 C# 生产消费模式 C# ConcurrentQueue 处理多任务 c# 线程池多任务处理并返回值 最近忙的一个项目(B/S) 共享设备综合运营管理系统(自研) 自动充值机 面向对象的七种设计原则 做过的项目 诗二首 诗三首 开源大全 C# PowerPoint操作的基本用法。 无锡质检局实验室管理系统 交互式电子白板 自己开发的 漂亮音乐播放器 钥匙齿形识别系统
SQL server 添加主外键约束
上海-天浩 · 2017-12-08 · via 博客园 - 上海-天浩

---添加主键约束            

alter table 表名      

add constraint 约束名 primary key (主键)          -

--添加唯一约束           

alter table 表名              

add constraint 约束名 unique (字段)       

---添加默认约束          

alter table 表名         

add constraint 约束名 default ('默认内容') for 字段             

--添加检查check约束,要求字段只能在1到100之间             

alter table 表名 

add constraint 约束名 check (字段 between 1 and 100 )        

---添加外键约束(主表stuInfo和从表stuMarks建立关系,关联字段为stuNo)    

        

alter table 从表              

add constraint 约束名 <br>   foreign key(关联字段) references 主表(关联字段)      

sql server中删除约束的语句是:          

alter table 表名 drop constraint 约束名             

sp_helpconstraint 表名 找到数据表中的所有列的约束