September 20, 2008 at 1:24 am
Hi
How to add Unique NONCLUSTERED CONSTRAINT to the
SQL Server 2005 table column?
I got that using following syntax:
ALTER TABLE
ADD CONSTRAINT [name of constraint] UNIQUE NONCLUSTERED
(
[column name] ASC
)
But how to set it in sql server 2005 designer?
Thanks in advance
September 22, 2008 at 7:30 am
Go into the table design view, right-click and select Indexes/Keys, click add new and change the Type to unique key.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
September 22, 2008 at 9:37 am
just a heads up and my already know if you do not elect to add a UNIQUE NON CLUSTERED constraint
SQL will elect to one on its own in the B+ tree. UNIQUE NON CLUSTERED constraint if possible make your unique NON CLUSTERED as one col and then use included columns ...this will reduce the root and intermediate nods and increase performance on on interest as well reduce fragmentation.
good luck
September 23, 2008 at 3:15 am
Thanks alot.
Thats what I was looking for.
How to create unique constraint over multiple columns?
September 23, 2008 at 5:51 am
ALTER TABLE
ADD CONSTRAINT [name of constraint] UNIQUE NONCLUSTERED
(
[column name1] ,
[column name2] ,
[column name3]
)
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
September 23, 2008 at 5:58 am
465789psw (9/22/2008)
just a heads up and my already know if you do not elect to add a UNIQUE NON CLUSTERED constraintSQL will elect to one on its own in the B+ tree.
Could you explain a bit more what you mean there please?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply