Can we have more than one NULL in a column having unique
constraint?

Answer Posted / manoj pandey

No this is not possible... columns with Unique constraint
can only contain 1 null value/row.

@Manish... could you please try this:

create table #tempTable (id int, name varchar(50) unique)

insert into #tempTable
select 1, 'manoj' union
select 2, null union
select 3, null union
select 4, 'pandey'

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mssql?

570


Can a database be shrunk with users active?

607


What are the different index configurations a table can have?

517


Tell me what is de-normalization and what are some of the examples of it?

569


Explain powershell included in sql server 2008?

615






What is BLOCK statements in SQL?

808


What is the difference between a unique key and primary key?

515


Does table partitioning improve performance?

536


What is 'write-ahead log' in sql server 2000 ?

627


How to insert multiple rows with one insert statement in ms sql server?

587


How connect excel to sql server?

508


Should you normalize audio?

531


What is meant by indexing files?

580


Is foreign key a primary key?

513


explain different types of cursors? : Sql server database administration

562