Create a table with an autogen field using SQL

  • Thread starter Thread starter kramer31
  • Start date Start date
K

kramer31

Can anyone tell me how to create a table a table with an autogen field?

I can do this to create a table

CREATE TABLE Employee
(
Name varchar(50),
Age int(3)
ID int(10)
)

but what if I want ID to be an autogen field?
 
Autogen is not a recognized access function - I think it is .NET, no?

I am guessing that you want your ID field to be automatically
incremented.

In that case, just go to your employee table design and set the ID data
type to AutoNumber.
 
Autogen is not a recognized access function - I think it is .NET, no?

I am guessing that you want your ID field to be automatically
incremented.

In that case, just go to your employee table design and set the ID data
type to AutoNumber.

Right. Sorry. That's what I was referring to. That's fine for a
single database, but I need to write an update script that can be run
on customers' databases so I need to be able to change that setting via
SQL.

Does anyone have any idea how to do this?
 

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

Back
Top