CREATE TABLE masterTbl (
id INT IDENTITY(1,1) CONSTRAINT pk_id PRIMARY KEY,
name VARCHAR(100))
INSERT INTO masterTbl VALUES (\'ABC\', \'XYZ\',\'PQR\')
It is possible performing the following steps:
I. Enable identity insert, which will DISABLE SQL Server from automatically inserting values in the table's identity column:
SET IDENTITY_INSERT ON
II. Perform your "manual" insert operation, SPECIFYING all the affected column names:
INSERT INTO masterTbl (id, name)
VALUES (1, 'ABC',
2, 'XYZ',
4, 'PQR')
III. When you're done, reenable the auto identity value insertion by disabling the manual insert feature of earlier:
SET IDENTITY_INSERT OFF
IV. You're done!