Inserts or updates records to a table.