October 27, 2014 at 11:02 pm
Comments posted to this topic are about the item Primary key vs Unique key
rkaram
October 27, 2014 at 11:07 pm
+1
Vimal LohaniSQL DBA | MCP (70-461,70-462)==============================The greatest barrier to success is the fear of failure ** Success is a journey not a destination**Think before you print, SAVE TREES, Protect Mother Nature
October 27, 2014 at 11:47 pm
Eaaazy, I think there was a similar question b4.
Have a nice day 🙂
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
October 28, 2014 at 12:41 am
Hany Helmy (10/27/2014)
Eaaazy, I think there was a similar question b4.Have a nice day 🙂
+1
October 28, 2014 at 1:25 am
"only one null " is someway misleading. Precisley it's a "only one null value per column".
October 28, 2014 at 1:36 am
Easy question, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 28, 2014 at 1:36 am
serg-52 (10/28/2014)
"only one null " is someway misleading. Precisley it's a "only one null value per column".
If the unique index is not a filtered index 😉
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 28, 2014 at 1:57 am
Question that is very often asked on interviews 🙂
Thanks!
October 28, 2014 at 1:58 am
Koen Verbeeck (10/28/2014)
serg-52 (10/28/2014)
"only one null " is someway misleading. Precisley it's a "only one null value per column".If the unique index is not a filtered index 😉
The question was about a unique "key", which I assume is intended to mean unique "constraint" not "index" (given the context with primary key in the same sentence, and the answer option about defauult index created).
One NULL is correct for a single-column constraint, not for composite. A better way to phrase it is that a UNIQUE constraint allows NULLs (as per ANSI standard), but treats NULL as a normal value that also has to conform to the uniqueness constraint (in violation of that same standard).
October 28, 2014 at 2:30 am
Koen Verbeeck (10/28/2014)
serg-52 (10/28/2014)
"only one null " is someway misleading. Precisley it's a "only one null value per column".If the unique index is not a filtered index 😉
It's another point of confusion. SQL has PRIMARY KEY but has no any 'UNIQUE KEY'. We have UNIQUE constraint and UNIQUE INDEX instead. Most probably 'UNIQUE KEY' here is supposed to be UNIQUE constraint which has no WHERE (filtering) option.
October 28, 2014 at 4:02 am
This was removed by the editor as SPAM
October 28, 2014 at 5:07 am
very easy question... 😀
Manik
You cannot get to the top by sitting on your bottom.
October 28, 2014 at 5:34 am
I'm glad I wasn't the only one to see "unique key" and think "unique constraint" automatically and then wonder if that was the rub.
October 28, 2014 at 6:21 am
+1
Thanks!
---------------
Mel. 😎
October 28, 2014 at 6:47 am
Good Question, thanks!
Viewing 15 posts - 1 through 15 (of 22 total)
You must be logged in to reply to this topic. Login to reply