TSQL transaction rollback on error | How to make a transaction in SQL Server that rolls back when an error occurs
In this episode, we’re going to look at SQL Server transactions, which can be critical in maintaining data integrity when you are executing many dependent SQL statements at one time. Using transactions will allow you to roll back a block of dependent statements if any of the statements fail, thus preventing damage to data integrity.
We’ll use transactions with a “try.. catch” block and with the ROLLBACK command. There are several ways to implement this including using the TRANCOUNT lookup.
Be sure to Like this video and Subscribe if you have not subscribed yet! Also click the Bell when you see the bell so that you’ll be notified of new content on the channel. If you have questions, please leave them in the comment section below and I will try to answer them. Enjoy!
Follow us on social media:
/ mackenziedataanalytics
/ seamacke
/ seamacke
/ seamacke
/ psmackenzie
Get Microsoft Office including Access:
https://click.linksynergy.com/fs-bin/...
Got a YouTube Channel? I use TubeBuddy, it is awesome. Give it a try:
https://www.tubebuddy.com/seanmackenz...
Database project? Contact me today! http://www.mackenziemackenzie.com/
Check out some of my earlier videos on Data Engineering:
How to Avoid SQL Injection by Using Parameterized Queries in .Net • How to Avoid SQL Injection by Using P...
SQL Server Percentiles - How to Use percentile_cont to Group Data by Upper, Middle, and Lower Thirds • SQL Server Percentiles - How to Use p...
How to Use DataViews to Filter and Sort ADO.Net DataTables • How to Use DataViews to Filter and So...
Insert One Million Rows into SQL Server - How to Use SqlBulkCopy • Insert One Million Rows into SQL Serv...
How to Make a Delimited List in One Field Using TSQL • How to Make a Delimited List in One F...
How to Extract Data from SQL Server Using vb.Net, SqlClient, and ConfigurationManager • How to Extract Data from SQL Server U...
sql rollback example, tsql rollback, tsql transaction with rollback, sql server try catch, sql server scope_identity, tsql scope_identity, sql server roll back, tsql roll back, sql rollback example, transactions in SQL server, error handling in tsql, tsql errors with try catch, tsql transaction errors, error handling in sql server, sql server error rollback, sean mackenzie data analytics