user152949
user152949

Reputation:

Transaction Isolation and many statement request

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

Answers (1)

Monty Wild
Monty Wild

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

Related Questions