Link to home
Start Free TrialLog in
Avatar of yrcdba7
yrcdba7Flag for United States of America

asked on

create non clustered non unique index sql server 2005

Expert,

how to create non unique non clustered index? Is this correct?

CREATE NONCLUSTERED INDEX IX_SalesPerson_SalesQuota_SalesYTD
    ON Sales.SalesPerson (SalesQuota);
GO
Thanks,

Lynn
Avatar of sventhan
sventhan
Flag of United States of America image

CREATE NONCLUSTERED INDEX IX_SalesPerson_SalesQuota_SalesYTD
    ON Sales.SalesPerson (SalesQuota);
GO

or

CREATE INDEX IX_SalesPerson_SalesQuota_SalesYTD
    ON Sales.SalesPerson (SalesQuota);
GO
Syntax:

create index index_name on table(columnname)
Avatar of Aaron Shilo
yes your syntax is currect
Avatar of yrcdba7

ASKER

Thank you,

how about clustered non-unique index?
ASKER CERTIFIED SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you syntax will create a nonclustered nonunique index

create NONCLUSTERED index ABC_IDX on mytable(mycolumn)  = nonclustered nonunique

create UNIQUE  NONCLUSTERED index ABC_IDX on mytable(mycolumn)  = nonclustered unique

create CLUSTERED index ABC_IDX on mytable(mycolumn)  = clustered nonunique

create unique  CLUSTERED index ABC_IDX on mytable(mycolumn)  = clustered unique
Avatar of yrcdba7

ASKER

Thankyou, Lynn