Reputation:
If I use serializable transaction isolation level and run a SQL query like:
CREATE DATABASE new_db;
use new_db;
CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
Will then use new_db
fail as the CREATE DATABASE new_db
statement is still not commited to the database?
Upvotes: 0
Views: 32
Reputation: 3991
CREATE DATABASE
is not allowed in a transaction. See here.
If this script was wrapped in an explicit transaction, it would throw an error on CREATE DATABASE new_db
Upvotes: 1