Click here to Skip to main content
15,912,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
AOA ... i am getting this error while inserting values into table....
like:
SQL
insert into Gl_Transaction values(001,001,0010010010006,'Furniture',103 ,'Opening Balance on 01-02-2013',   '2013-02-01',   0000000026,'    JV',    20000.00,   0.00    ,NULL,  NULL,   NULL    ,12300)
insert into Gl_Transaction values(001,001,0010010010006,'Furniture',103 ,'Opening Balance on 01-02-2013',   '2013-02-01',   0000000026,'    JV',    0.00,   20000.00    ,NULL,  NULL,   NULL    ,12300)

i already set identity of table on but did not work.

like:
SQL
set identity_insert gl_Transaction On
insert into Gl_Transaction values(001,001,0010010010006,'Furniture',103 ,'Opening Balance on 01-02-2013',   '2013-02-01',   0000000026,'    JV',    20000.00,   0.00    ,NULL,  NULL,   NULL    ,12300)
insert into Gl_Transaction values(001,001,0010010010006,'Furniture',103 ,'Opening Balance on 01-02-2013',   '2013-02-01',   0000000026,'    JV',    0.00,   20000.00    ,NULL,  NULL,   NULL    ,12300)
set identity_insert gl_Transaction Off

what can i do?? :(
Posted
Comments
[no name] 19-Apr-14 8:19am    
'Gl_Transaction' can only be specified when a column list is used and IDENTITY_INSERT is ON.

1 solution

Just read the error message carefully. It says "can only be specified when a column list is used and IDENTITY_INSERT is ON." You have the second half but you need the first half. You need to specify the column list.

SQL
INSERT INTO gl_Transaction (identity_field, field1, field2, field3, ...)
VALUES (001, 001, ...)
 
Share this answer
 
Comments
Member 10690757 19-Apr-14 8:22am    
thanx :) :)
ZurdoDev 19-Apr-14 8:45am    
You're welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900