• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Add index to table

I have a table with a primary key.
How would I add an index to an additional column?
0
Larry Brister
Asked:
Larry Brister
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you create another index, normally on just that column.

what is the exact issue you have?
0
 
malikirfan28Commented:
There are normally two types of indexes - Clustered and non-Clustered. Primary keys normally create clustered index. So which type of index do you want to create on another column?

If you want to create nonclustered index then you can simply use

CREATE INDEX INDEX_NAME
on TABLENAME (COLUMN NAME)
0
 
Larry Bristersr. DeveloperAuthor Commented:
angelIII:

I have a table that stores our media "mail history" ...actual addresses for bulk mail

the mailID is the primary key

Ive been asked to add an index on AddrID column
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Neil RussellTechnical Development LeadCommented:
So if your table is called MailHistory you would use

CREATE INDEX idxAddrID
on MailHistory (AddrID)
0
 
Larry Bristersr. DeveloperAuthor Commented:
malikirfan28: was first and Neilsr: was precise

Any problems with a 350/150 split?
0
 
malikirfan28Commented:
You didn't mention the table name/column name so I could not give precise example :(
But I gave you the syntax.
0
 
Alpesh PatelAssistant ConsultantCommented:
Hey you can create a non cluster index on other than primary key. Same as cluster index

Create index Indexname on Table (Columnname)
0
 
Larry Bristersr. DeveloperAuthor Commented:
malikirfan28
You have a  valid point
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now