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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 unique constraint

Author  Topic 

Kurmanc
Yak Posting Veteran

92 Posts

Posted - 2008-04-04 : 09:28:49
Anybody knows how to make two columns in a table unique?

Kurmanc
Yak Posting Veteran

92 Posts

Posted - 2008-04-04 : 09:34:58
OK, I solved it. For anybody out there who is asking this question, here is the solution:

CREATE TABLE example (
a integer,
b integer,
c integer,
UNIQUE (a, c)
);
Go to Top of Page
   

- Advertisement -