July 30, 2012 at 8:24 am
Stewart "Arturius" Campbell (7/30/2012)
Good reminder, Thanks DwainIf anyone comes even close to that limit, however, I would seriously propose a remedial database design course, with a healthy heaping of normalisation thrown in for good measure...:-P
+1
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 30, 2012 at 8:58 am
Jeff Moden (7/30/2012)
I was pretty sure of the answer but went to check just to be absolutely sure because I've never gotten close to the limit. It just absolutely fascinates me that this little bit of very important "trivia" ISN'T covered under the constraints, primary key, or CREATE TABLE sections of BOL.
Me too.
First I was like, well it's a CLUSTERED INDEX and those can only have 16 columns.
Then I was like, well if it is explicitly made non clustered, it make a non clustered index so it can still have only 16
But then I had to go check just to be sure.
July 30, 2012 at 9:11 am
Good question. I recalled this limit being mentioned recently as related to another QOTD.
July 30, 2012 at 9:36 am
July 30, 2012 at 10:21 am
A nice and easy one to start the week with... Thanks!
July 30, 2012 at 12:48 pm
Thomas Abraham (7/30/2012)
Jeff Moden (7/30/2012)
I was pretty sure of the answer but went to check just to be absolutely sure because I've never gotten close to the limit. It just absolutely fascinates me that this little bit of very important "trivia" ISN'T covered under the constraints, primary key, or CREATE TABLE sections of BOL.Same reaction, both to the question and BOL. Also, wasn't there a recent question that was tangentially related to this? Something about large data types in an index?
Maybe the recent question about an XML index, which will hijack one of the 16?
Tom
July 30, 2012 at 8:31 pm
Wow! I would have never imagined that such a simple basic question would generate so much dialogue.
It turns out that I was trying to create a key with 18 components and I got rejected. Note that this was a pretty contrived case (I'd never actually design a database like that :-D) in a temporary table whereI was hoping the additional key elements might improve performance.
Surely now it is something I'll never forget either.
Thanks to all for stopping by and commenting!
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
July 30, 2012 at 9:27 pm
I GOT IT WRONG!...i referred following page
http://msdn.microsoft.com/en-us/library/ms191236(v=sql.105).aspx
which says
“If a PRIMARY KEY constraint is defined on more than one column, values may be duplicated within one column, but each combination of values from all the columns in the PRIMARY KEY constraint definition must be unique.”
GOOD QUESTION…… +1
Thank you
July 31, 2012 at 2:38 am
Good question,
Thanks!
-------------------------------------------------------------
"It takes 15 minutes to learn the game and a lifetime to master"
"Share your knowledge. It's a way to achieve immortality."
July 31, 2012 at 7:18 am
easy but very important question !!!
Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
July 31, 2012 at 8:19 am
L' Eomot Inversé (7/30/2012)
Thomas Abraham (7/30/2012)
Jeff Moden (7/30/2012)
I was pretty sure of the answer but went to check just to be absolutely sure because I've never gotten close to the limit. It just absolutely fascinates me that this little bit of very important "trivia" ISN'T covered under the constraints, primary key, or CREATE TABLE sections of BOL.Same reaction, both to the question and BOL. Also, wasn't there a recent question that was tangentially related to this? Something about large data types in an index?
Maybe the recent question about an XML index, which will hijack one of the 16?
Yes, that was how I got it right. The XML index question was fresh on my mind. I can't imagine coming close to this limit so it's not one that will be on the tip of my pencil.
August 8, 2012 at 11:31 am
Good question!
October 18, 2012 at 5:42 am
+1
Viewing 13 posts - 16 through 27 (of 27 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy