• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Field increment

I'm creating a table like the 1 below through VB.NET

 '' New table string
            Dim tmpSql As New StringBuilder
            tmpSql.Append("CREATE TABLE TOPS_CREW_CRANE (")
            tmpSql.Append("TypeID int, ")
            tmpSql.Append("Sequence nvarchar(5), ")
            tmpSql.Append("Description nvarchar(100), ")
            tmpSql.Append("BaseQty tinyint, ")
            tmpSql.Append("Factor decimal(15, 3))")

How can I make TypeID an identity field so it automatically increments?
0
thenrich
Asked:
thenrich
1 Solution
 
doraiswamyCommented:
I presume it is MySql.
Try "TypeID int auto_increment,"
0
 
thenrichAuthor Commented:
SQL server 2005

sorry
0
 
drydenhoggCommented:
TypeID [int] IDENTITY(1,1) NOT NULL

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now