Results 1 to 2 of 2
  1. #1
    irowake is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    1

    Create multiple index in a data definition query

    Hi,



    Is there any way to create multiple indexes with a unique indexname in 1 single data definition query?

    ex. CREATE INDEX myindex1 ON mytable(myfield1)
    CREATE INDEX myindex2 ON mytable (myfield2)


    Kind regards,
    Karen

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I think you will need 1 statement per index.
    This is general format

    Code:
     CREATE INDEX     CREATE INDEX index_name
    ON table_name (column_name)
    
    or
    
    CREATE UNIQUE INDEX index_name
    ON table_name (column_name)
    You can create indexes in Access( see diagram below)
    In Table design mode, go to indexes.

    You can add and name multiple indexes, then save the table.

    For demo, I added 3 indexes based on field hrs
    Click image for larger version. 

Name:	Indexes.jpg 
Views:	8 
Size:	217.9 KB 
ID:	25984

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-02-2016, 10:59 AM
  2. Design tab, Data Definition
    By MiaAccess in forum Access
    Replies: 1
    Last Post: 10-25-2014, 05:18 PM
  3. Replies: 5
    Last Post: 04-05-2014, 08:52 PM
  4. first create table in MS access data definition sql view
    By learning_graccess in forum Access
    Replies: 1
    Last Post: 10-14-2011, 06:23 AM
  5. Create an index in existing database
    By blip in forum Programming
    Replies: 1
    Last Post: 05-21-2010, 11:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums