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 |
|
saeidus20
Starting Member
1 Post |
Posted - 2011-09-27 : 04:08:29
|
| hi I'm so new in sql and programmingI just wanted to make a unique value in a table but i dont know how!i meant i dont want to make a primary key just want a unique valuefor example : name(unique)/text/not null)some one told me i should make it index or some thing thanks for your helpsaeidus20 |
|
|
Ranjit.ileni
Posting Yak Master
183 Posts |
Posted - 2011-09-27 : 04:14:03
|
| http://blog.sqlauthority.com/2007/02/05/sql-server-primary-key-constraints-and-unique-key-constraints/--Ranjit |
 |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 2011-09-27 : 04:19:13
|
| Hi,You can use Unique Key concept.Unique Key do following1)Enforces uniqueness of the column on which they are defined. 2)Creates a non-clustered index on the column. 3)Allows only one NULL Value.Example "ALTER TABLE table_name ADD CONSTRAINT constraint_name UNIQUE(ColumnName)"Please mark answer as accepted if it helped you.Thanks,Jassi Singh |
 |
|
|
|
|
|