Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating table with autonum field

Status
Not open for further replies.

michelleqw

Programmer
Jan 4, 2004
120
DE
Dear sql kids,

We am trying to create a table with an autonumbering field, knows someone the syntax?

Good start of 2005!

Michelle.
 
We did found the answere:

tlbroadbent (MIS) May 21, 2002

Use Identity to create a an auto incrementing column.

Create table MyTable
(RecID Int Identity, PartNo varchar(16), ...)

You can specift an identity seed and increment value, also.

Create table MyTable
(RecID Int Identity(101,1), PartNo varchar(16), ...)

Terry L. Broadbent - DBA
Computing Links:
FAQ183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top