Select field1, field2, ..., field10 From sourceTable Into Cursor cuTmp Set Database To yourDatabase If InDBC("targetTable","Table") If !Used("targetTable") Use targetTable In 0 Exclusive EndIf Select targetTable Zap Append From DBF("cuTmp") Else Copy To targetTable Database yourDatabase EndIfmethod 2: Check for the existence of the target table, if there, drop it
Select field1, field2, ..., field10 From sourceTable Into Cursor cuTmp Set Database To yourDatabase If InDBC("targetTable","Table") If Used("targetTable") Use In targetTable EndIf Drop Table targetTable EndIf Copy To targetTable Database yourDatabase