Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

identity column in sql server

/* To explicitly supply a value for identity column*/
/*first turn on identity_insert  set  identity_insert (Table_Name) on*/
SET IDENTITY_INSERT (Table_Name) ON

/*In the insert query specify the column's list insert into table*/
INSERT INTO (Table_Name) (Identity_Column,col2,col3,...) VALUES (Identity_Value,val2,val3,...)

/* Now set the identity_insert set off*/
SET IDENTITY_INSERT (Table_Name) OFF
 
PREVIOUS NEXT
Tagged: #identity #column #sql #server
ADD COMMENT
Topic
Name
9+6 =