-
MS SQL insert in the middle and reset auto increment
In case you need to insert something in the middle and need to set autoincremented column to some particular values, you can do the following: Set Identity_Insert [TableName] On -- Turn off identity insert for your Table ----------------------------------- Insert TableName (pkCol, [OtherColumns]) Values(pkValue, [OtherValues]) ----------------------------------- Set Identity_Insert [TableName] Off -- Turn off identity insert for…
Loading posts...