Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases Modifying Data with SQL Handling Errors When Manipulating Data Introduction to Transactions

Sql Transactions?

After committing to a database does the 'transaction block' get executed line by line or not. If yes then there would be no difference between a script which gets too executed line by line in a block (the script itself)

1 Answer

ivana kantnerova
ivana kantnerova
14,695 Points

the difference is when the script is interrupted we will not be able to return the changes that have already been made but the transaction has a special feature (atomicity - it will be done all or nothing). that means that all the instructions that have been executed will be returned and we can start again (without losing the data)