I have a simple table :
CREATE TABLE [dbo].[ImageTable] (
[CONTA] int IDENTITY(1, 1) NOT NULL,
[IMG] image NULL,
[DATA] date NULL,
PRIMARY KEY CLUSTERED ([CONTA] ASC)
WITH ( PAD_INDEX = OFF,
FILLFACTOR = 100,
IGNORE_DUP_KEY = OFF,
STATISTICS_NORECOMPUTE = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON,
DATA_COMPRESSION = NONE )
and with new option I try to generate datas for test. I connect to DB and table without problem.
See my screenshot in attach with error :
I want generate 1000 records to test. I generate these records directly in the table but I obtain an error as you can see from my screenshot.
The problem is that this table contain a field - CONTA - of type autoincrement. This table still contains about 20 records. Conta is primary key of table.
Before start to generate test data I select option to empty the table, to avoid to generate a double primary key.
But the problem still remain. Your tool try to generate test data with value for field CONTA that start from 1 and end to 1000.
Table is empty but option IDENTITY_INSERT if OFF and you can’t insert a value for this field.
When you generate test data for a field that contains an autoincrement field you must set IDENTITY_INSERT ON , insert a correct value from 21,22,23,24,etc,etc, and after set iDENTITY_INSERT OFF.
I stay tune for your consideration.