March 21, 2010 at 8:04 am
When are Kim and Paul coming to Atlanta... this sounds like a great lecture.
Jamie
March 30, 2010 at 8:13 am
Good question, but the wording could have been clearer. Nice easy points though - thanks.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
April 1, 2010 at 1:18 am
Hi Hugo,
The 3rd and 6th options seems similar.
Shaiju C.K.
_____________________________________________
One ounce of practice is more important than tonnes of dreams
April 1, 2010 at 1:33 am
C.K.Shaiju (4/1/2010)
Hi Hugo,The 3rd and 6th options seems similar.
Shaiju C.K.
You are right! Thanks for pointing it out. The sixth option should have read "A clustered index exists ..." instead of "No clustered index exists ..."
I have edited my post to prevent future confusion.
April 3, 2010 at 2:39 am
When we creates the primary key it alwas enforce to create as Clustured.
how it will enforce to create as NonClustered.
Please Can u tell me.
April 3, 2010 at 2:53 am
parthenitin (4/3/2010)
When we creates the primary key it alwas enforce to create as Clustured.how it will enforce to create as NonClustered.
Please Can u tell me.
Use the NONCLUSTERED keyword.
See Creating and Modifying PRIMARY KEY Constraints
Example:
DECLARE @Table
TABLE (
column1 INTEGER NOT NULL
PRIMARY KEY NONCLUSTERED
);
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
April 3, 2010 at 6:29 am
parthenitin (4/3/2010)
When we creates the primary key it alwas enforce to create as Clustured.how it will enforce to create as NonClustered.
Please Can u tell me.
In addition to the reply by Paul -- if there is already a clutered index on the table, then the index for the primary key will also default to nonclustered.
April 4, 2010 at 2:21 pm
Thanks Hugo. That was the main one (and point) I was making.
Often people use scripts to create objects but there are strange cases where multiple developers working on the same project creates... er... "issues" and the indexes aren't quite as consistent as expected. Constraints are often created via scripts but often as standalone scripts (not always as part of the table's create) and sometimes problems can occur when there are too many cooks in the kitchen. 😉
Cheers!
Kimberly L. Tripp
SQL Server MVP, Microsoft Regional Director
May 27, 2011 at 3:54 am
False, if a clustered index already exists, DB will enforce the Primary Key constraint with a nonclustered index
May 27, 2011 at 3:55 am
if a clustered index already exists, SQL Server will enforce the Primary Key constraint with a nonclustered index
Viewing 10 posts - 31 through 39 (of 39 total)
You must be logged in to reply to this topic. Login to reply