insert into identity column
Hello :) I'm developping an application, and i have an indentity column in my database. At some point i need to insert something in the identity column..is there a way to do this? because i get an error. thanks!
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 1, 2013, 11:42 AM
You can do this like below
SET INDENTITY INSERT ON
insert into table(EmpId) values(101)
SET INDENTITY INSERT OFF
Regards,
Iftikar
Violeta PopaPosted Jul 1, 2013, 3:00 PM
Sanjeeb LenkaPosted Jul 1, 2013, 12:18 PM
http://blog.sqlauthority.com/2009/05/03/sql-server-add-or-remove-identity-property-on-column/
http://www.sqlteam.com/article/how-to-insert-values-into-an-identity-column-in-sql-server