Vasanth Jack

Vasanth Jack

  • NA
  • 289
  • 35.5k

Explicit Error in Sqlserver while creating a procedure

Jan 4 2017 8:31 AM
HI
I Have a stored procedure to insert datas from c#.When i create a stored Procedure it throw an error.The error is given below
An explicit value for the identity column in table 'tbl_seat' can only be specified when a column list is used and IDENTITY_INSERT is ON.
 
create procedure sp_insert_seat @A1 varchar(5),@A2 varchar(5),@A3 varchar(5),@A4 varchar(5),@A5 varchar(5),@A6 varchar(5),@A7 varchar(5),@A8 varchar(5),@A9 varchar(5),@A10 varchar(5),@A11 varchar(5),@A12 varchar(5),@A13 varchar(5),@A14 varchar(5),@A15 varchar(5),@A16 varchar(5),@A17 varchar(5),@A18 varchar(5),@A19 varchar(5),@A20 varchar(5), @S1 varchar(5),@S2 varchar(5),@S3 varchar(5),@S4 varchar(5),@S5 varchar(5),@S6 varchar(5),@S7 varchar(5),@S8 varchar(5),@S9 varchar(5),@S10 varchar(5),@S11 varchar(5),@S12 varchar(5),@S13 varchar(5),@S14 varchar(5),@S15 varchar(5),@S16 varchar(5),@S17 varchar(5),@S18 varchar(5),@S19 varchar(5),@S20 varchar(5), @id int as begin insert into tbl_seat values(@id,@A1,@A2,@A3,@A4,@A5 ,@A6 ,@A7 ,@A8 ,@A9 ,@A10 ,@A11 ,@A12 ,@A13,@A14 ,@A15 ,@A16 ,@A17 ,@A18 ,@A19 ,@A20, @S1,@S2,@S3 ,@S4 ,@S5 ,@S6 ,@S7 ,@S8 ,@S9 ,@S10 ,@S11 ,@S12 ,@S13 ,@S14 ,@S15 ,@S16 ,@S17 ,@S18 ,@S19 ,@S20) end
 
I tried the "Set Identiy_insert tbl_name ON"
I try this method but also it throws the error .

Answers (3)