Copy Data from One SQL Server Table to Other in Same Database Without Specifying Columns
- by Scott
In SQL Server there is the ability to INSERT all of the data from one table into another using the following statement:
INSERT INTO TABLE1 SELECT * FROM TABLE2
When running this on a table with an identity column, even though we have run the command SET IDENTITY_INSERT TABLE1 ON, we get the error:
An explicit value for the identity column in…