Primary Key Index in Make Table Query

G

Guest

I have a Make Table Query which makes a table called "Companies." The source
for the query is a table named "Outlook." I wish to make a one of the fields
which is created in table "Companies" a Primary Key Index. How can I do this?
 
G

Granny Spitz via AccessMonster.com

William said:
I wish to make a one of the fields
which is created in table "Companies" a Primary Key Index. How can I do this?

By running a second query that uses DDL SQL to alter the table after you run
the make table query. You need to create a new query and open it in SQL view
to type this yourself, hon. I don't know which column and data type you want
your primary key to be, but here's an example of an AutoNumber called ID:

ALTER TABLE Companies
ALTER COLUMN ID COUNTER
CONSTRAINT PrimaryKey PRIMARY KEY;
 
G

Guest

Thanks for your Help!!!!

Granny Spitz via AccessMonster.com said:
By running a second query that uses DDL SQL to alter the table after you run
the make table query. You need to create a new query and open it in SQL view
to type this yourself, hon. I don't know which column and data type you want
your primary key to be, but here's an example of an AutoNumber called ID:

ALTER TABLE Companies
ALTER COLUMN ID COUNTER
CONSTRAINT PrimaryKey PRIMARY KEY;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top