Mega Code Archive

 
Categories / MSSQL Tutorial / Sequence Indentity
 

Create table with IDENTITY column

The basic syntax  for creating a table is as follows: CREATE TABLE [database_name].[owner].table_name    (column_name data_type [length] [IDENTITY(seed, increment)] [NOT NULL]) 9> CREATE TABLE Groups ( 10>    Id int IDENTITY (1, 1) NOT NULL 11> ) 12> GO 1> 2> drop table Groups 3> GO