在 SQL Server 2008 GUI 中添加唯一约束? [英] Add unique constraint in SQL Server 2008 GUI?

查看:23
本文介绍了在 SQL Server 2008 GUI 中添加唯一约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含数据的现有表.我刚刚添加了一个新列,但找不到如何在该列上添加唯一约束.有人可以建议吗?右键单击并选择检查约束"没有帮助.

I have an existing table with data. I have just added a new column but I cannot find how to add a unique constraint on that column. Could someone please advise? Right-clicking and selecting "check constraints" wasn't helpful.

推荐答案

您需要在表设计器中右击并选择Indexes/Keys:

You need to right-click in the table designer and pick Indexes/Keys:

然后会弹出一个对话框,您可以向索引列表中添加一个新索引(在左侧)并将其定义为 unique 索引:

Then a dialog pops up and you can add a new index to the list of indices (on the left hand side) and define it to be a unique index:

这篇关于在 SQL Server 2008 GUI 中添加唯一约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆