sql server在怎麼建非聚集索引

解决方案 »

  1.   

    create index index_name on tableName(col)
      

  2.   

    create index id_tb_name on tb(col)
      

  3.   

    这就是非聚集
    CREATE index [INDEX_NAME] on table(col)
      

  4.   

    create index TEST on emp(FIELD1,FIELD2)
      

  5.   

    Use test
    Go
    If object_id('Users') Is Not Null
    Drop Table Users
    Go
    Create Table Users
    (
    ID int Identity(1,1),
    Code nvarchar(50),
    Name nvarchar(50),
    Constraint PK_Users_ID Primary Key(ID Asc)--默认会建立1个名称为 PK_Users_ID的聚集索引
    )
    Go--在Code 上创建一个非聚集索引
    Create Nonclustered  Index IX_Users_Code On Users(Code Asc)
    Go
      

  6.   

    create index index_name on tableName(col) 這是非聚集索引還是聚集索引,如果是非聚集索引,那聚集索引怎麼建?
      

  7.   

    create index index_name on tableName(col) 是非聚集索引
    create clustered index index_name on tableName(col) 是聚集索引
      

  8.   

    reate index index_name on tableName(col) 是非聚集索引
    create clustered index index_name on tableName(col) 是聚集索引
      

  9.   


    --建普通索引
    create index 索引名 on 表(字段)
    --唯一索引
    create unqiue index 索引名 on 表(字段)
    --聚集索引create clustered index 索引名 on 表(字段)
      

  10.   

    普通索引就是非聚集索引,建非聚集索引必须在有聚集索引的前提下
    create index 索引名 on 表     --这是非聚集索引
    create clustered index 索引名 on 表      --这是聚集索引