Has anyone used tools for code generation?
I use MyGeneration, which is freeware and can generate business logic code based on a database you define. The code generated can be in any language (PHP, HTML, C#, SQL etc).

It is a .NET app, so the framework is required.

It does it via a programmable user interface and works with MSSQL, Oracle, IBM DB2, MySQL and MS Access.

It is template driven and is scriptable via JScript, VBScript, DotNetScript C#, DotNetScriptVB. Several useful templates available (stored procedures, data insertion/deletion/replication) and because it is template driven you output code can be very robust and bug free, saving development time and debugging.