Stored Procedure IDENTITY_INSERT

Posted by Jacob on Stack Overflow See other posts from Stack Overflow or by Jacob
Published on 2011-06-23T13:19:48Z Indexed on 2011/06/23 16:22 UTC
Read the original article Hit count: 195

I'm recently change my data table, I remove column and add a new column that define as identity = True and identity seed = 1, identity increment = 1. When i tried to insert data to this table by STORE PROCEDURE i get this exception:

An explicit value for the identity column in table 'AirConditioner' can only be specified when a column list is used and IDENTITY_INSERT is ON.

I saw that i need to add this lines: SET IDENTITY_INSERT [dbo].[AirConditioner] ON and finally OFF I added and its still throw an exception...

My store procedure is attached as a pictureenter image description here

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sql