Not sure how that can be done on a large scale. But to do it individually to a post - this is the query to use:
UPDATE w3t_Posts SET B_Reged = 'y', B_PosterId = number
B_Reged is set to 'y' for "yes" meaning they are registered and B_PosterId is the user number.
The name is being stored in the B_AnonName field - I'm not sure if there's a way to do a query which matches them up and would let you update the whole thing at a time.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.