This doesn't work if T has an identity column. I tried
DELETE FROM B.T INSERT INTO B.T SELECT * FROM A.T
However, this doesn't work either; it requires that I explicitly list the columns. I can do that, of course, but it's tedious and error-prone. Almost every table has an identity column. Is there some better way to do this?
SET IDENTITY_INSERT B.T OFF DELETE FROM B.T INSERT INTO B.T SELECT * FROM A.T SET IDENTITY_INSERT B.T ON
From novice to tech pro — start learning today.