且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在SQL Server 2005中创建复合唯一约束

更新时间:2023-02-07 13:49:22

在SQL Server Management Studio中

In SQL Server Management Studio


  • 转到对象资源管理器

  • 选择表并打开其设计器(不记得了它的内容在2005年被称为-修改表还是什么?)

  • 在表设计器中,从工具栏(带有小键的表)中选择管理索引和键图标

  • 在其中添加新索引并为其命名,单击其唯一设置

  • goto the Object Explorer
  • pick your table and open its designer (can't remember what it was called in 2005 - Modify Table or something?)
  • in the table designer, pick the "Manage Indexes and Keys" icons from the toolbar (the table with the little key)
  • in there, add a new index and give it a name, click it's "Unique" setting



  • 打开索引定义中的列列表,然后添加列想要加入索引


就是这样! :)