|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 8:48 AM
Points: 2,440,
Visits: 714
|
|
When are Kim and Paul coming to Atlanta... this sounds like a great lecture.
Jamie
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 5:01 PM
Points: 10,990,
Visits: 10,545
|
|
Good question, but the wording could have been clearer. Nice easy points though - thanks.
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Sunday, March 03, 2013 10:42 PM
Points: 179,
Visits: 561
|
|
Hi Hugo,
The 3rd and 6th options seems similar.
Shaiju C.K.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:49 PM
Points: 5,244,
Visits: 7,063
|
|
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.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, February 15, 2013 5:28 AM
Points: 927,
Visits: 61
|
|
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.
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 5:01 PM
Points: 10,990,
Visits: 10,545
|
|
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 SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:49 PM
Points: 5,244,
Visits: 7,063
|
|
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.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 9:26 AM
Points: 27,
Visits: 44
|
|
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 blog: www.SQLskills.com/blogs/Kimberly twitter: www.twitter.com/KimberlyLTripp
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, February 18, 2013 10:54 PM
Points: 371,
Visits: 110
|
|
| False, if a clustered index already exists, DB will enforce the Primary Key constraint with a nonclustered index
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, February 18, 2013 10:54 PM
Points: 371,
Visits: 110
|
|
| if a clustered index already exists, SQL Server will enforce the Primary Key constraint with a nonclustered index
|
|
|
|