Reputation: 66
I want to migrate the data from one table to another. Here Table1 has identity column. I require Table2 to have same data and identity.
How can I do this?
Upvotes: 1
Views: 172
Reputation: 8574
Admittedly, this is very basic, but would this work?
SET IDENTITY INSERT dbo.Table2 ON
INSERT INTO dbo.Table2
SELECT ...
FROM dbo.Table1
SET IDENTITY INSERT dbo.Table2 OFF
Upvotes: 1