Sounds like you are inserting to a database table with an
identity column. Identity columns increment the record set as they
are inserted to the table (ie, 1,2,3,4,...) You cannnot explicitly
insert into this column, so instead of
insert into myTable (id, value) values (5, 'my text')....
you would do
insert into myTable (value) values ('my text')
, if the identity column is "id".
Alternately, you can do an identity insert it the "id" value
does not exist. You would first need to set identity inserts on you
table to "ON" in your SQL statement before doing the INSERT.
set identity_insert myTable ON
go
insert into mytable (id, value) values (6, 'my text')
go
set identity_insert myTable OFF
That may not be the exact syntax for the indentity
statement... But the id = 6 must not already exist in table or it
will fail anyway.
A use of this may be at some point you deleted a record with
id = 6, and want to reinsert it, but the next identity value for id
is 10, lets say.... so if you do a regular insert to the table your
next id is 10, if you set your identity insert to ON before doing
the insert, you can explicitly set the id to "6", and insert the
old record.