Hi,
I have table with one column as Identity column, if I delete a row number 6 which
has Identity column seed value as 6 then if insert a new row in the table then
how can I insert same number 6 in the identity column?
I tried in google but I couldn't get it.
Please let me know.
Loading
SenthilkumarPosted Mar 16, 2012, 10:50 AM
When column set as identity column then you do not have any control to insert the value explicitly.
But you can turn off the identity column.
If you are persist to insert the value on identity column then
SET IDENTITY_INSERT table_name ON
If you want to continue the identity column then
SET IDENTITY_INSERT TestTable OFF
You cam find some examples in the following link
http://awesomesql.wordpress.com/2009/09/15/insert-values-into-identity-column-of-sql-server-table-disable-identity-column-in-sql-server-2005/
If you found it is useful then mark it as "Accepted Answer"