SQL Server - Unique Key Accepts How many null values in Oracle and Microsoft Sql Server?

Asked By koteswara rao arvapalli on 18-Jun-13 05:32 AM

Hi Friends,

first I ask what is Unique Key?

Diffrence between Sq;l Server Unique Key && Oracle Unique Key?

Unique Key Accepts How many null values in Oracle and Microsoft Sql Server?

And Why?
Robbe Morris replied to koteswara rao arvapalli on 18-Jun-13 10:15 AM
A column that must contain unique values across all rows in a table.

       columnA
row 1:   Robbe
row 2:   Robbe

Because two rows have the same value in columnA, this would violate the unique key constraint.

Oracle permits this type of violation if the column is nullable (at least that is how it worked awhile back).  I believe SQL Server is going to require a workaround like what is discussed here:

http://decipherinfosys.wordpress.com/2007/11/30/multiple-null-values-in-a-unique-index-in-sql-serverdb2-luw/
Leonie Kruger replied to koteswara rao arvapalli on 20-Jun-13 09:18 AM
Hi,

Unique key is just a key that uniquely identifies each record. For example, if the record is people, the unique key can be the ID number. 

SQL Server and Oracle are just different relational database management systems.

No null values allowed for unique key.