Running SQL commands against all GP Company Databases

This is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.
Last week, I posted the article below explaining how you can use the osql.exe command to run a script against all Microsoft Dynamics GP company databases. The method described in this post is best if you have a *.sql script file to execute against each company database:
