Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6969031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:31:44+00:00 2026-05-27T16:31:44+00:00

Are sql statements such as CREATE TABLE tbl_name ….. allowed in transactions. For example:

  • 0

Are sql statements such as CREATE TABLE tbl_name ….. allowed in transactions.

For example:

begin;

CREATE TABLE .......;

sdfghjk;

rollback;

The table is still created despite a statement in the transaction failing, and a rollback at the end. Is there a way to prevent the table from being created if a statement in the transaction fails?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:31:45+00:00Added an answer on May 27, 2026 at 4:31 pm

    DDL statements are allowed within transactions, but are not generally impacted by the transactions. From the MySQL Documentation on what can and cannot be rolled back:

    Some statements cannot be rolled back. In general, these include data
    definition language (DDL) statements, such as those that create or
    drop databases, those that create, drop, or alter tables or stored
    routines.

    You should design your transactions not to include such statements. If
    you issue a statement early in a transaction that cannot be rolled
    back, and then another statement later fails, the full effect of the
    transaction cannot be rolled back in such cases by issuing a ROLLBACK
    statement.

    Source

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file containing a lot of SQL statements, such as: CREATE TABLE
In an SQL Server 2008 database, I have tables such as: CREATE TABLE t_DeviceType
I've got quite a few SQL statements like such: SELECT foo FROM things WHERE
After running the following SQL statements, you will see that, MySQL has automatically created
What is the accepted practice for indenting SQL statements? How should this example be
i have got a problem with my SQL Statement: Table structure: CREATE TABLE tags
What's the execute order of the different parts of a SQL select statement? Such
I have some sql statements that calculates some numbers. It's possible (with bonus points/penalty
I am translating SQL Server SQL Statements into their ANSI generic equivalent at present,
In a project of mine the SQL statements that are executed against a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.