my $sth = $dbh->prepare('SELECT * FROM [Production Words]'); $sth->execute; # finish the rest of this line after you design the new table my $new_sth = $dbh->prepare('INSERT INTO new_table ...'); my %hash; while (my $row = $sth->fetchrow_hashref) {