I want to write an SQL script for MS SQL Server that would update data in one table with information in another table where the two tables relate on a common field. In FoxPro I would have just opened table1 and then did a scan loop. Inside the scan loop I would do an UPDATE to update the field in table2 with the information from a field in table1.
So let's say we have the following:
TABLE1.recid (related) TABLE2.recid
TABLE1.field1 TABLE2.field2
I want to update TABLE2.field2 with whatever is in TABLE1.field1 and the two tables are related by recid. Since I can't do a scan loop in the SQL Query, how would I accomplish this?