H
harry
Hi,
I am unable to insert new rows into an SQL table with a Identity Column (The
Identity column is also the Primary Key).
The table is a new empty table, and the Identity column is set to Seed=1 and
Increment=1
The error I receive when attempting to insert 3 new rows is:
Column RecNum is contrained to be unique. Value '1' is already present.
These are the values being inserted.
0 1188110 False 3
1 1216300 False 4
2 1182714 False 3,4
The first Column with IDENTITY value=0 is inserted however as it is the
first row it's Identity is set to 1. Therefore the subsequent row with
Identity=1 triggers exception I guess?
How do I solve this? Shouldn't ADO.NET manage this bu itself?
Thanks
Harry
I am unable to insert new rows into an SQL table with a Identity Column (The
Identity column is also the Primary Key).
The table is a new empty table, and the Identity column is set to Seed=1 and
Increment=1
The error I receive when attempting to insert 3 new rows is:
Column RecNum is contrained to be unique. Value '1' is already present.
These are the values being inserted.
0 1188110 False 3
1 1216300 False 4
2 1182714 False 3,4
The first Column with IDENTITY value=0 is inserted however as it is the
first row it's Identity is set to 1. Therefore the subsequent row with
Identity=1 triggers exception I guess?
How do I solve this? Shouldn't ADO.NET manage this bu itself?
Thanks
Harry