Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Stanley Tan
Starting Member
25 Posts |
Posted - 2002-10-20 : 07:21:39
|
| Hi,Is it possible to have a unique constraint across two columns? For example:A B-- ---BS BIOBS BIOIf I tried to insert the second row, it would fail. Is this possible? :) |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-10-20 : 07:55:19
|
| Yes. |
 |
|
|
LarsG
Constraint Violating Yak Guru
284 Posts |
Posted - 2002-10-20 : 07:59:03
|
| Sure,alter table t add constraint ABUnique Unique(A,B) |
 |
|
|
Stanley Tan
Starting Member
25 Posts |
Posted - 2002-10-21 : 04:35:23
|
quote: Sure,alter table t add constraint ABUnique Unique(A,B)
Seems easy enough :) Thanks! Can I do this with Enterprise Manager? (Hehe, getting lazy). |
 |
|
|
|
|
|