// Copy all rows from table1 to table2.
// Potentially, these two tables could be in different databases.
void DynamicCopy(tstring table1, tstring table2, DBConnection &conn1, DBConnection &conn2) {
{
	DynamicDBView<>::Args arg1, arg2;
	arg1.tables(table1).fields("*").conn(conn1);
	arg2.tables(table2).fields("*").conn(conn2);

	DynamicDBView<> view1(arg1), view2(arg2);

	DynamicDBView<>::insert_iterator write_it = view2;

	// Copy database fields by name, converting types as needed. 
	// This assumes fields in the two tables have the same name.
	copy(view1.begin(), view1.end(), write_it);
}