I use XSLT to do that. Write up your XSD then pass your data models through a hand written XSLT that outputs SQL commands. Writing an XSLT is way faster and reusable than a custom program /script you may write.
At least thats how I do it at work, and thanks to that I got time to hang out on SO :)