SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


T-SQL


T-SQL

Author
Message
pchirags
pchirags
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3651 Visits: 617
Comments posted to this topic are about the item T-SQL
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)

Group: General Forum Members
Points: 174806 Visits: 18671
I have to disagree with the correct answer(s). The question asks for 4 correct answers yet 5 are presented. This causes a bit of a guessing game.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

demonfox
demonfox
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4253 Visits: 1192
SQLRNNR (1/3/2013)
I have to disagree with the correct answer(s). The question asks for 4 correct answers yet 5 are presented. This causes a bit of a guessing game.

I didn't read the last one ; when marked 4th one , I should read complete question and answers ;-)..
yes the last one is correct, Unique key does allow one null.

"The Unique key allows NULL values as a value"

is an answer too..

~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one Ermm
Dineshbabu
Dineshbabu
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2122 Visits: 569
Since last option said Unique key allows NULL values.. he didn't mention xactly one NULL value in the option . so I choosed other 4 and got it correct..

--
Dineshbabu

--
Dineshbabu
Desire to learn new things..
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)

Group: General Forum Members
Points: 174806 Visits: 18671
dineshbabus (1/3/2013)
Since last option said Unique key allows NULL values.. he didn't mention xactly one NULL value in the option . so I choosed other 4 and got it correct..

--
Dineshbabu


That is true, but a Unique constraint can allow more than one null value.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

Dineshbabu
Dineshbabu
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2122 Visits: 569
oh.. unique constraint can allow more than one null value.. I don't think so.. Please give me some xample...

--
Dineshbabu
Desire to learn new things..
Kingston Dhasian
Kingston Dhasian
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13406 Visits: 5346
dineshbabus (1/3/2013)
oh.. unique constraint can allow more than one null value.. I don't think so.. Please give me some xample...


In SQL Server 2008, there is a concept of filtered indexes.
You can combine this concept with Unique Constraint to create a unique constraint which allows more than one NULL value.


Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Dineshbabu
Dineshbabu
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2122 Visits: 569
I think few days back same conversation happened... Unique constraint is different from unique index. While creating unique index we can create with filter and that will allow more than one NULL value but not with unique constraint.

--
Dineshbabu

--
Dineshbabu
Desire to learn new things..
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)

Group: General Forum Members
Points: 174806 Visits: 18671
dineshbabus (1/3/2013)
I think few days back same conversation happened... Unique constraint is different from unique index. While creating unique index we can create with filter and that will allow more than one NULL value but not with unique constraint.

--
Dineshbabu


Go back to that QOTD thread and read my response showing that multiple null values is possible in a unique constraint.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)SSC Guru (174K reputation)

Group: General Forum Members
Points: 174806 Visits: 18671
dineshbabus (1/3/2013)
oh.. unique constraint can allow more than one null value.. I don't think so.. Please give me some xample...


Here is the example

http://www.sqlservercentral.com/Forums/FindPost1398825.aspx

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search