Skip to main content
HomeSQL

Transactions and Error Handling in SQL Server

Learn to write scripts that will catch and handle errors and control for multiple operations happening at once.

Start Course for Free
4 hours14 videos52 exercises14,085 learnersTrophyStatement of Accomplishment

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Group

Training 2 or more people?

Try DataCamp for Business

Loved by learners at thousands of companies


Course Description

It is critical to know how to handle errors and manage transactions when programming SQL scripts. Unhandled errors can be very harmful and can cause unexpected situations, such as inconsistent data in your database, or even worse, errors can lead you to make wrong business decisions. In this course, you will learn how to handle errors and discover how to manage transactions in case of an error. Additionally, you will study what happens when two or more people interact at the same time with the same data. You will practice all these concepts using two datasets, one of them based on bank accounts and the other one on an electric bike store.
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
DataCamp for BusinessFor a bespoke solution book a demo.

In the following Tracks

SQL Server Developer

Go To Track

SQL Server for Database Administrators

Go To Track
  1. 1

    Starting with error handling

    Free

    To begin the course, you will learn how to handle errors using the TRY...CATCH construct that provides T-SQL. You will study the anatomy of errors, and you will learn how to use some functions that can give you information about errors.

    Play Chapter Now
    Welcome!
    50 xp
    The TRY...CATCH syntax
    50 xp
    Your first error-handling script
    100 xp
    Nesting TRY...CATCH constructs
    100 xp
    Error anatomy and uncatchable errors
    50 xp
    Anatomy review
    50 xp
    Correcting compilation errors
    100 xp
    Giving information about errors
    50 xp
    Error function syntax
    50 xp
    Using error functions
    100 xp
    Using error functions in a nested TRY...CATCH
    100 xp
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

In the following Tracks

SQL Server Developer

Go To Track

SQL Server for Database Administrators

Go To Track

datasets

Electric bike store dataset and Bank accounts dataset

collaborators

Collaborator's avatar
Mona Khalil
Collaborator's avatar
Marianna Lamnina
Miriam Antona HeadshotMiriam Antona

Software Engineer

Miriam is a freelance Software Engineer with 15+ years of experience. She is focused on analyzing, designing, and developing software applications. She also collaborates with the UOC University supervising Bachelor theses. Miriam loves programming and experimenting with different technologies. She is passionate about databases and enjoys playing with data. She holds a Master of Science Degree in Computer Engineering.
See More

What do other learners have to say?

Join over 15 million learners and start Transactions and Error Handling in SQL Server today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.