Hi guys,
are there such things as autonumber datatypes in SQL??
I have the following code that create a table from code, but i want the first column to be an autonumber that SQL server can take care of.
if there isnt a way to create autonumbers, is it best just to increment a number from the last record in the table??Code:sqlTableConnection = New SqlConnection(strConnectionStr) sqlTableConnection.Open() 'create table code sqlTableComm = New SqlCommand("CREATE TABLE Contects (Title VARCHAR(6) NOT NULL, Firstname VARCHAR(20) NOT NULL, Lastname VARCHAR(20) NOT NULL, Created DATETIME NOT NULL, Deleted BIT NOT NULL)", sqlTableConnection) sqlTableComm.ExecuteNonQuery() sqlTableConnection.Close()
cheers,





Reply With Quote