if i try to add some data into my table error occurs:
Error:Msg 8101, Level 16, State 1, Line 1 An explicit value for the identity column in table 'ENG_PREP' can only be specified when a column list is used and IDENTITY_INSERT is ON.
insert into ENG_PREP VALUES('572012-01-1,572012-01-2,572012-01-3,572013-01-1,572013-01-2',
'',
'500',
'',
'A320 P.001-A',
'Removal of the LH Wing Safety Rope',
'',
'',
'',
'0',
'',
'AF',
'12-00-00-081-001',
'',
'',
'',
'',
'',
'',
'' )
Your statement
will try to insert values into all of the columns of your table - including the IDENTITY column, where you should never insert a specific value.
What you need to do is specify which columns of your table you really want to insert values into, and leave out the IDENTITY column - that'll be automatically handled by SQL Server itself:
You only need to specify those columns that you really want to set a value for (e.g. you can probably skip most of those columns where you just insert a
''
in your example).If you must write to the identity column, use
just as the error message suggests.
Otherwise, don't try to write to the identity column.