Can we use more than one null value for unique key?
Answer Posted / praveen hr
UNIQUE Constraints
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.
Multiple UNIQUE constraints can be defined on a table,
whereas only one PRIMARY KEY constraint can be defined on a
table.
Also, unlike PRIMARY KEY constraints, UNIQUE constraints
allow for the value NULL. However, as with any value
participating in a UNIQUE constraint, only one null value
is allowed per column.
A UNIQUE constraint can be referenced by a FOREIGN KEY
constraint.
Link from MSDN http://msdn.microsoft.com/en-
us/library/ms191166.aspx
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How do you use collections in procedure to return the resultset?
how to analyze tables with 'mysqlcheck'? : Sql dba
What does select * from mean in sql?
What is sql profiler in oracle?
What is a recursive join sql?
How do you truncate?
What is sql*loader and what is it used for?
How to add new employee details in an employee_details table with the following details
What is sqlca in db2?
What is varchar example?
what happens if null values are involved in expressions? : Sql dba
What is a design view?
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
How to display Row Number with Records in Oracle SQL Plus?
How many types of sql are there?