Click to See Complete Forum and Search --> : SQL Command, How to Create Table with autonumber column?


wjlin
February 13th, 2002, 04:36 PM
Does anyone know how to use SQL command to Create/Alter Table with autonumber column? I was looking for field data type for Access DataBase from msdn online help, and wondering there is no auto number data type.

My SQL command is like:
CREATE TABLE pTable(Column1 integer)

and Column1 field will be long integer data type, how can I make it as autonumber data type?

Thanks in advance!!

Wenjung Lin

Manish Malik
February 15th, 2002, 09:25 AM
Check the first syntax example given at the following page:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q209037


Manish
http://www.manishmalik.com

Discuss it all at the Developer Forum : http://www.codeguru.com/cgi-bin/bbs/wt/wwwthreads.pl?action=list&Board=devforum ...

nonnb
February 16th, 2002, 04:50 AM
you can use idenitity eg

create table bob
(
id integer identity(1,1) not null,