I need to move all existing rows in table A over to table B. I also need to select ONLY the moved rows from table A. (Not from Table B since Table B is an archive and contains a lot of rows which will result in the select taking a lot of time)
I'm using Microsoft SQL Server 2008 and .Net (System.Data.SqlClient)
Please note that records are inserted continuously to Table A. I need to ensure only the moved records are selected and that they are selected from Table A before they are deleted.
What is the most efficient way to do this?