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 |
|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2008-07-18 : 00:19:54
|
| Let's say i've this following table,tblusertypeUsertype | RolesID--------------------IT Support | 1IT Support | 2Technician | 1IT Support | 3Technician | 2...............*There's no repetition value in combination of Usertype and RolesID.*Combination of Usertype and RolesID field will generate a unique value (primary key).How to make sure there's no repetion value in tblusertype? It is using rules or ??? in tblusertype design? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-18 : 02:42:53
|
[code]CREATE TABLE tblusertype( Usertype varchar(10), RolesID int, CONSTRAINT PK_tblusertype PRIMARY KEY (Usertype, RolesID))[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2008-07-18 : 03:20:54
|
| if using management studio, how to right click and ...??The tblusertype already created. can you show methe syntax in alter table? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-18 : 04:36:26
|
quote: Originally posted by Delinda if using management studio, how to right click and ...??The tblusertype already created. can you show methe syntax in alter table?
ALTER TABLE tblusertype ADD CONSTRAINT PK_tblusertype PRIMARY KEY (Usertype, RolesID) |
 |
|
|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2008-07-18 : 05:48:34
|
| it's work. TQVM. |
 |
|
|
|
|
|