|
-
Jul 16th, 2009, 07:01 AM
#1
Thread Starter
Fanatic Member
column options in sql
Hello, I got a question about sql. How can I create a column that values can not repeat, so there can be no identicall values in that column (just like a PK). Well I remember I can do this in MS Access by ticking one of the options, but in the sql I didn't see such an option.
-
Jul 16th, 2009, 07:39 AM
#2
Re: column options in sql
You create a unique index on the column.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 16th, 2009, 08:04 AM
#3
Thread Starter
Fanatic Member
Re: column options in sql
and how to do that in SQL studio please ?
-
Jul 16th, 2009, 08:20 AM
#4
Re: column options in sql
I do it by code.
Create Unique Index Un_Table1FirstNameLastName on Person
(FirstName,LastName)
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 16th, 2009, 01:40 PM
#5
Addicted Member
Re: column options in sql
Or you can add a unique key constraint for that column during the creation of the table or alter the table and add the constraint
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|