Biker John
Biker John

Reputation: 2711

Mysql multiple table creation

Is there a possibility to execute multiple CREATE TABLE within one mysql query?

Upvotes: 0

Views: 59

Answers (1)

Polynomial
Polynomial

Reputation: 28346

No. You must do them in multiple queries.

<incorrect>However, you can wrap the creation queries in a transaction to allow you to roll back the entire operation if something fails.</incorrect>

UPDATE: Ok, as pilcrow points out, each create causes an implicit commit, so you can't use transactions for this. You can, however, wrap the inserts (for a backup restore) in transactions.

Upvotes: 2

Related Questions