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
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
Efficient Query

Performance Challenge – Write Efficient Query – SQL in Sixty Seconds #140

October 30, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Operator, SQL Performance, SQL Scripts, SQL Server, SQL Server Management Studio

Recently while working with my client I ended up in a very interesting situation where my client wanted me to write an Efficient Query.

Read More
Gouache painting of a wall of wooden cubbies holding envelopes, with one vermilion envelope in one cubby

Scan Count Zero in STATISTICS IO: What the Number Means

October 28, 2020
Pinal Dave
SQL Performance
Execution Plan, SQL Scripts, SQL Statistics

Scan count zero in STATISTICS IO is not an error and not a free read. This post runs nine small queries and shows what 0, 1, 2 and 5 mean, why a unique lookup counts as zero, and why logical reads are the number to compare.

Read More
An existing overgrown garden section remains beside newly planted orderly seedlings

How to Add Constraint With No Validation? – Interview Question of the Week #299

October 25, 2020
Pinal Dave
SQL Interview Questions and Answers
SQL Constraint and Keys, SQL Error Messages, SQL Identity, SQL Scripts, SQL Server

Question: How to Add Constraint With No Validation?

Answer: I got this question from one of my clients of who is an Oracle user.

Read More
Gouache painting of three padlocks on a bench, each with a vermilion key in it

Check Constraint on Identity Column: Why Inserts Fail

October 24, 2020
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Identity, SQL Scripts

A check constraint on identity column values can make every insert fail, because the identity moves on whether or not the row is accepted. This post reproduces the failure, shows that the failed attempts still use up identity values, and lists every such constraint in a database with one query.

Read More
Gouache painting of a pantry shelf of fresh jam jars with one dusty jar with a vermilion lid at the back

Oldest Statistics in SQL Server: Find the Stale Ones First

October 21, 2020
Pinal Dave
SQL Performance
SQL DMV, SQL Scripts, SQL Statistics

To find the oldest statistics in SQL Server, read the last update time and the number of changes since. This post builds a small demo, lists every statistic with its age and percent changed, and shows why a high change count on its own is not a reason to update by hand.

Read More
Gouache painting of three fruit bowls in a row where two hold pears and the middle one is empty and vermilion

Add Columns With NULL in SQL Server: ISNULL, COALESCE or SUM

October 19, 2020
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Scripts

To add columns with NULL in SQL Server, first decide what an empty value means. This post sums three nullable columns with the plus operator, ISNULL, COALESCE and SUM, shows where each one differs on a row of all NULLs, and compares their CPU cost on two million rows.

Read More
Previous 1 … 26 27 28 29 30 31 32 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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