Marius0188
asked on
MS SQL 2005 Express :: Give non key field UNIQUE constraint?
Hi Experts,
Please give me all the necessary steps in order to set a non-key field to unique constraint.
Note that I am using the "SQL Server Management Studio Express".
Thanks in advance!
Please give me all the necessary steps in order to set a non-key field to unique constraint.
Note that I am using the "SQL Server Management Studio Express".
Thanks in advance!
do you mean just create unique constraint?
if you have create table tbl ( f1 int, f2 char(1), f3 bit, f4 datetime )
and you want to make sure that f4 (the datetime) is unique, you'd add a constraint using
alter table tbl add constraint uq_f4 unique(f4)
and you want to make sure that f4 (the datetime) is unique, you'd add a constraint using
alter table tbl add constraint uq_f4 unique(f4)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you provide the steps in the Studio Management Tool?
For example:
Select "Contstraints", right click and select "New Constraint".... etc.
Thanks
For example:
Select "Contstraints", right click and select "New Constraint".... etc.
Thanks