There is no simple way of doing this (unless you want to grant sysadmin rights, which would be bad). You will have to either do this with dynamic SQL, or write a query to output commands like:
USE dbname; exec sp_adduser loginname, username; exec sp_addrolemember db_owner username;
I am not sure if sp_adduser is still supported in SQL2008, so you may need to play around with the query to generate those commands. If you know powershell, you can probably come up with a better more flexible solution.