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 are the advantages of policy management?

582


What is coalesce in sql server?

533


Which table keeps the locking information?

519


How to see the event list of an existing trigger using sys.trigger_events?

567


How many types of built in functions are there in sql server 2012?

486






What are the encryption mechanisms in sql server?

572


What is the purpose of sql profiler in sql server?

509


How to provide values to stored procedure parameters in ms sql server?

527


What is SQL Server?

660


What is the difference between mysql and sql server?

467


Explain about builtinadministrator?

585


What is difference between foreign key and unique key?

546


What are sp_configure commands and set commands?

558


How to create a user to access a database in ms sql server using "create user" statements?

518


what's the difference between delete table and truncate table commands? : Sql server database administration

482