SQL Server better way to iterate through millions of rows
问题 I am working with SAP Timesheet data, so there are millions of rows. What I am trying to do is select the data from the SAP table and insert it into a table on MS SQL Server. So I want to insert the original record, then if an update to the original record happens, which is in the form of a new SAP record with a refcounter , I want to find the original record in my table and update it, keeping the original counter value. So I have done this successfully with a cursor (I know not the best),