Scenario: While retaining the IDENTITY column, how to merge two tables from different databases with same schema
Solution:All you have to do is run the below mention query
SET IDENTITY_INSERT target_database.owner.target_table ON
INSERT INTO target_table (col1, col2, ..., colN) SELECT FROM source_table(col1, col2, ..., colN)
SET IDENTITY_INSERT target_database.owner.target_table OFF
Have fun
Remember Me
Powered by: newtelligence dasBlog 1.8.5223.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2010, Danish Sami, et.al.
User Group Lead