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 |
|
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 tabletry tat...ok |
 |
|
|
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. |
 |
|
|
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 |
 |
|
|
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. |
 |
|
|
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 askinghe was asking a way to create unique key from designer |
 |
|
|
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 |
 |
|
|
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. |
 |
|
|
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 askinghe was asking a way to create unique key from designer
thanks you have got my requirement. |
 |
|
|
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... |
 |
|
|
|
|
|
|
|