June 8, 2015 at 2:43 pm
Can you point me out to an resource or may be you can answer the difference between the different types of indexes
Primary Key, Unique key, Clustered, Non Clustered
I know primary key has to be declared on a NOT NULL column(s) , Can only have one per table. Values must be unique
Do we agree ?
Primary Key uses a B-TREE like structure.
Hmm.. Can it be clustered ?
Lets talk.
June 8, 2015 at 3:10 pm
Well firstly a primary key isn't a type of index. A primary key is a table constraint that requires that the column is not nullable and unique. A primary key is enforced with an index, either clustered or nonclustered.
Unique isn't a type of index either, it's a property of an index. An index, clustered or nonclustered, can be defined as unique.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2015 at 3:26 pm
Have you checked out the stairway on indexes? http://www.sqlservercentral.com/stairway/72399/%5B/url%5D
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
June 8, 2015 at 3:48 pm
In addition to the Stairway, always remember to reference the Books Online.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
June 9, 2015 at 12:52 am
Don't forget this online lecture too.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply