Just an idea on this limitation of SQL:
This is a
declarative language, which is the opposite to
imperative. It does not provide a sequence of any instructions to be carried out. When you try to execute a whole "batch" in a
multi-statement transaction, you are not really saying: "alter the database and then, when altering is complete, update the altered database". You are not saying "update the database and then alter it" either. The transaction only ensures that all the requests to the database are executed
as if there were no other users working of at this database in parallel. (In fact, some other statements
could be actually performed in parallel, but the transaction mechanism guarantees the behavior
as if logically it wasn't the case.) It has serious implication on the object of transactional action. Altering the database has to be performed in a separate statement, not part of your multi-statement transaction.
Please see:
http://en.wikipedia.org/wiki/Declarative_programming[
^],
http://en.wikipedia.org/wiki/Imperative_programming[
^],
http://en.wikipedia.org/wiki/Transaction_processing[
^].
—SA