Solved

Field increment

Posted on 2007-03-26
3
258 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
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 new code templates in NetBeans IDE 8.0 for Windows.

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now