This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Two hands unpacking a mixed harvest box into separate wicker baskets of carrots, leeks, apples and radishes.

Shredding JSON Into Relational Tables in One Pass

September 28, 2021
Pinal Dave
SQL Tips and Tricks
JSON, Output Clause, SQL Server, SQL Transactions

Use shredding JSON to stage parent and child rows, validate their data, capture identity mappings, and load relational tables atomically.

Read More
Gouache painting: a wooden loom holding a half-woven linen runner in cream and sage, the last stretch unpicked into loose threads on the floor, with one vermilion knot marking where the finished cloth ends

SAVE TRANSACTION: Roll Back Half a Transaction

September 15, 2021
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Lock, SQL Stored Procedure, SQL Transactions

SAVE TRANSACTION sets a marker inside an open transaction. You can roll back to it and keep the earlier work. This post tests it on SQL Server 2025. It shows why a nested BEGIN TRAN can’t do the same and what XACT_STATE() returns after an error.

Read More
Gouache painting of a windowsill with six jars of jam and a vase of wildflowers, one jar vermilion

TRUNCATE TABLE WITH PARTITIONS: Empty One Partition Fast

July 1, 2021
Pinal Dave
SQL Performance
SQL Delete, SQL Scripts, SQL Transactions, Table Partitioning

TRUNCATE TABLE WITH PARTITIONS empties one partition and logs far less than DELETE. See the syntax, the index rule and the limits in SQL Server.

Read More
Two beach towels thrown onto one empty deckchair at once, a cream towel covering the seat and a red one sliding off.

Handling Duplicate Key Errors 2627 and 2601 in a CATCH Block

April 15, 2021
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Error Messages, SQL Server, SQL Transactions

Handle duplicate key errors 2627 and 2601 in TRY CATCH, preserve unexpected errors, and avoid racing existence checks during inserts.

Read More
A heavy sled hauled almost to the top of a snowy slope, its red rope trailing back down

Before You KILL a Session: Estimating the Rollback Cost

February 4, 2021
Pinal Dave
SQL Tips and Tricks
DBA, SQL Lock, SQL Server, SQL Transactions

Before you KILL a session, inspect its transaction age, log bytes, current command, and likely rollback work, then monitor the undo safely.

Read More
Transactions and Variables

Transactions and Variables – SQL in Sixty Seconds #150

January 22, 2021
Pinal Dave
SQL Tips and Tricks
SQL in Sixty Seconds, SQL Scripts, SQL Server, SQL Transactions

Transactions and Variables both are not related at all. There is no impact of a transaction on a variable. Let us learn about it today.

Read More
Gouache painting of a seedling in a clay pot beside a glass bell jar covering a lit candle

DDL in a Transaction: What Rolls Back and What Blocks

November 3, 2020
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Transactions, Transaction Isolation

DDL in a transaction works in SQL Server: CREATE, ALTER and DROP roll back like any other change. This post proves it with a small demo, lists the statements that are refused inside a transaction, and shows which locks an open DDL transaction holds and who has to wait for them.

Read More
Previous 1 2 3 4 5 … 15 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com