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)
 how to set unique key in the design mode

Author  Topic 

cruxmagi
Starting Member

38 Posts

Posted - 2009-01-09 : 01:47:13
Instead of writing script in the query editor,i want to set a column as unique.Do we have any property as Set Unique Key like as Set Primary Key

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2009-01-09 : 01:54:40
yes ofcourse, u can change column property and set as primary key..
by modify option of ur table
try tat...
ok
Go to Top of Page

cruxmagi
Starting Member

38 Posts

Posted - 2009-01-09 : 02:13:04
I already have a primary key in my table, i want to make another column as unique.Though we will be able to achieve through writing query in the editor,i want to check out is there any way to set manually.
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-01-09 : 02:15:21
A table can have only one PRIMARY KEY constraint,But One Table has upto 16 columns set to primary key
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-01-09 : 02:22:53
You can use UNIQUE constraints to make sure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-09 : 02:46:51
quote:
Originally posted by Nageswar9

You can use UNIQUE constraints to make sure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key.




you are not answering what OP's asking
he was asking a way to create unique key from designer
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-01-09 : 03:02:55
Go to Table Right Click On It,,
Den Modify,,,It,,
Then After On Left hand Side Manage Indexes And Keys ..
then Click oN Add Button there,,after that u choose ur column name,,,
and other options,,,

I think That i get u right n reply what u really want,,,if i get u wrong then sry for that....

Thanks Ny ways
Go to Top of Page

cruxmagi
Starting Member

38 Posts

Posted - 2009-01-09 : 03:33:41
quote:
Originally posted by ashishashish

Go to Table Right Click On It,,
Den Modify,,,It,,
Then After On Left hand Side Manage Indexes And Keys ..
then Click oN Add Button there,,after that u choose ur column name,,,
and other options,,,

I think That i get u right n reply what u really want,,,if i get u wrong then sry for that....

Thanks Ny ways


Thanks a lot,your solution worked out.
Go to Top of Page

cruxmagi
Starting Member

38 Posts

Posted - 2009-01-09 : 03:37:07
quote:
Originally posted by visakh16

quote:
Originally posted by Nageswar9

You can use UNIQUE constraints to make sure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key.




you are not answering what OP's asking
he was asking a way to create unique key from designer


thanks you have got my requirement.
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-01-09 : 04:09:05

quote:
Originally posted by cruxmagi

quote:
Originally posted by ashishashish

Go to Table Right Click On It,,
Den Modify,,,It,,
Then After On Left hand Side Manage Indexes And Keys ..
then Click oN Add Button there,,after that u choose ur column name,,,
and other options,,,

I think That i get u right n reply what u really want,,,if i get u wrong then sry for that....

Thanks Ny ways


Thanks a lot,your solution worked out.


Thanks,,,,n your always welcome...
Go to Top of Page
   

- Advertisement -