Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Index field !

Status
Not open for further replies.

HadiRezaee

Technical User
Joined
Mar 9, 2001
Messages
165
Location
IR
Hi all,
I maked a table and three fields inside the table ...
How can i make a field as Index Field ?
I must use CREATE INDEX statment ?
 
I'm not sure if this is what you need. I think your trying to create a Index field. In Access i used an autonumber, but when i converted to SQL i needed to use the identity key. Make sure the data type is "int". Make sure following match in the Columns info.:
Indentity "YES"
Indentity Seed "Leave blank or put a # in" If you wanted the index to start with 2000 you should put 2000 in there.
Identity Increments "1" this will the index field grow by one after each record.
Also try doing a help search on "Columns property page" it explains it in there as well
Hope this helps

 
If you are using SQL server EM open the table that has the field you want to index.

Right click on the field and select properties.

Select new. Rename the index name is you want to something more meaningful. Select the field you want to index in the dropdown list.

Hope this helps.
 
Hadi,

You can also use the Create Index statement in T-SQL to create an index on one or more columns in the table.

Example: Create clustered index on 1 column
Create Clustered Index IxEmpName
On tblEmployees (EmpName)

Example: Create unique index on 3 columns
Create Unique Index IxPartNo
On tblPartInfo (PNBody, PNSfx, PNPfx) Terry L. Broadbent
Programming and Computing Resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top