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 |
|
SwitchNix
Starting Member
3 Posts |
Posted - 2008-08-01 : 11:35:06
|
| Hello,With SQL Server 200 (management studio), I'd like to add a constraint to a field. I'd like a value must be unique for all record in the table. How can I do that via the GUI or/and by programmingExample : if you have a USER table the login field must be unique Regards, |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-08-01 : 11:37:07
|
| Did you check Books online before you post here? Books online comes with SQL server. |
 |
|
|
SwitchNix
Starting Member
3 Posts |
Posted - 2008-08-01 : 11:56:28
|
| Yes but I didn't find what I want ... |
 |
|
|
SwitchNix
Starting Member
3 Posts |
Posted - 2008-08-01 : 12:02:29
|
| Found :ALTER TABLE [dbo].[TableName]ADD CONSTRAINT CK_Name UNIQUE (FieldName) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-01 : 12:52:20
|
| a simple search on google would have given you this linkhttp://doc.ddart.net/mssql/sql70/aa-az_5.htm |
 |
|
|
|
|
|