SQL Server Performance

About Implementing ClusterIndexing!!!!!!

Discussion in 'General DBA Questions' started by tdnithin, Sep 12, 2006.

  1. tdnithin New Member

    First I created a cluster Index on One column.what happen if I create a primarykey on another column??????

    please answer my Question!!!!!!!!!!!!!!!!!!
  2. dineshasanka Moderator

    you can't create.
    only one clstered index is possible. Primary key is a clestered key

    ----------------------------------------

  3. Roji. P. Thomas New Member

    quote:Originally posted by dineshasanka

    you can't create.
    only one clstered index is possible. Primary key is a clestered key
    No. Primary key can be clustered or Non-Clustered.

    See below.
    CREATE TABLE Test(id int NOT NULL, x int NOT NULL)
    GO
    CREATE CLUSTERED INDEX IX_x ON Test(x)
    GO

    ALTER TABLE Test
    ADD CONSTRAINT PK_Test PRIMARY KEY(id)
    GO
    sp_help Test

    Roji. P. Thomas
    Microsoft SQL Server MVP
    http://toponewithties.blogspot.com
  4. dineshasanka Moderator

    opps. yeah I made a mistake. Primary is Unique not nessary clustered. thanks roji

    ----------------------------------------

  5. satya Moderator

    Clustering is different and CLuster index is differnt, post moved to relevant forums

    Satya SKJ
    Microsoft SQL Server MVP
    Contributing Editor & Forums Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing.
  6. tdnithin New Member

    Thanks for Replying Roji!!!!!!!!!!!

Share This Page