i need to get ready to migrate our moodle database to mssql for the new servers comming in summer, i have created the link between the mysql and mssql databases i currently have, and ive found a pice of sql code that will copy over a table at a time

SELECT * INTO moodle.dbo.(tablename)
FROM openquery(MYSQL, 'SELECT * FROM moodle.(tablemane)')

is there any way of ajusting the sql statemt so it will loop through all found tables and then end?

im not ver familiar with all sql syntax