Solved

Field increment

Posted on 2007-03-26
3
272 Views
Last Modified: 2013-11-07
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
Comment
Question by:thenrich
3 Comments
 
LVL 8

Expert Comment

by:doraiswamy
ID: 18792370
I presume it is MySql.
Try "TypeID int auto_increment,"
0
 
LVL 5

Author Comment

by:thenrich
ID: 18792377
SQL server 2005

sorry
0
 
LVL 8

Accepted Solution

by:
drydenhogg earned 250 total points
ID: 18792397
TypeID [int] IDENTITY(1,1) NOT NULL

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML - Color not displaying correctly in EMAIL. 6 49
VB.net capture  result of a SQL query in variables 3 21
tempdb log keep growing 7 34
Visual studio 2015 1 22
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question