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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding an MSSQL Identity field in vb code 1

Status
Not open for further replies.

MattN

Programmer
Jan 21, 2002
29
0
0
GB
Could anyone tell me how to add a field in an MS SQL table.

This field must be;-

Integer
Identity = Yes
Identity Seed = 1
Identity Increment = 1


Kind Regards

Matt N
 
How are yout trying to add a field, SQL statements or SQLDMO? Are you creating a table from scratch or adding a field?

Here is how I create an identity field using SQL statements,

Code:
CREATE TABLE [Customer] ([CustomerID] [int] IDENTITY (1, 1) NOT NULL ,[Field2]...

Take Care,

zemp

"If the grass looks greener... it's probably because there is more manure."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top