you mentioned you have a script that does tables too - could you possibly post that?

I'm newbie trying to build a script generator to update a list of 'config' tables in another database - so need to work through a list of tables (tbl_tablestoreplace) and create a script of them - including their fields, keys, indexes and data?