Create a table with an autogen field using SQL

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?
 
D

dcichelli

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.
 
K

kramer31

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?
 
Top