|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Anyone looking for a way to modernize legacy data or easily migrate to a more cost-effective database without sacrificing functionality will benefit from this seminar. View the Intro to Advantage Database Server now! |
|
#1
|
|||
|
|||
|
Auto Increment?
In MYSQL, there was a column option for auto-increment. Is there such a thing in MSSQL? How do I set up a column to auto-increment when a new record is added?
Thanks! Matthew |
|
#2
|
|||
|
|||
|
When you define your column add IDENTITY. Here is a sample from the SQL Server BOL
Code:
CREATE TABLE new_employees ( id_num int IDENTITY(1,1), fname varchar (20), minit char(1), lname varchar(30) ) |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Auto Increment? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|