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 white cloth covering an unseen lump beside a small wooden box fitted around a pear

Parameter Sniffing Local Variable: What the Trick Fixes

December 20, 2019
Pinal Dave
SQL Tips and Tricks
Parameter Sniffing, SQL Scripts, SQL Statistics, SQL Stored Procedure

The parameter sniffing local variable trick copies a parameter into a variable so SQL Server cannot sniff it. This post measures the estimate and the page reads of a sniffed and a local variable procedure, called in both orders. It shows what the trick fixes, and what it leaves slow.

Read More
Illustrated cover: Parameter Sniffing

SQL SERVER – Parameter Sniffing Simplest Example

December 19, 2019
Pinal Dave
SQL Tips and Tricks
Execution Plan, Parameter Sniffing, SQL Scripts, SQL Server, SQL Stored Procedure

Today we will see a very simple example of the Parameter Sniffing. Let us see a very simple example of the parameter sniffing.

Read More
Gouache painting of a row of cream parcels each with a small brass bell on top, one parcel wrapped in vermilion

NOCOUNT Performance: What SET NOCOUNT ON Saves in a Loop

December 18, 2019
Pinal Dave
SQL Performance
SQL Cursor, SQL Scripts, SQL Server, SQL Stored Procedure

NOCOUNT performance depends on the messages that SQL Server no longer sends to the client. This post counts the network packets of a procedure with a 5,000 step loop, with the setting off and on. It also explains why some tests show no time gain, and where the setting helps most.

Read More
Gouache painting of a wooden birdhouse with a vermilion roof, a feather and twigs at its doorway, on a wooden bench

Copy Database Without Statistics and Query Store Data

December 17, 2019
Pinal Dave
SQL Tips and Tricks
Execution Plan, Query Store, SQL Scripts, SQL Server DBCC, SQL Statistics

To copy database without statistics, add NO_STATISTICS and NO_QUERYSTORE to DBCC CLONEDATABASE. This post shows why that matters, because histograms and Query Store texts hold real values. It also shows the plan estimate that changes, how to make a clone writable, and what VERIFY_CLONEDB does.

Read More
A hand watering the one dry pot in a row of geraniums on a porch step, the other pots left alone

Skipping No-Op Updates: Changing Only Rows That Really Differ

December 16, 2019
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Scripts, SQL Server, SQL Server 2022, SQL Trigger

Skip no-op updates with NULL-safe EXCEPT or IS DISTINCT FROM, inspect affected counts, and avoid unnecessary rowversion and trigger changes.

Read More
Gouache painting of a cream vase with sage branches beside a smaller empty cream vase with a vermilion rim

Clone Database in SQL Server With DBCC CLONEDATABASE

December 16, 2019
Pinal Dave
SQL Performance
Execution Plan, Query Store, SQL Scripts, SQL Server DBCC, SQL Statistics

Clone Database in SQL Server with DBCC CLONEDATABASE and you copy the structure and the statistics without a single row. This post runs the command on a demo database, checks what the clone holds and what it leaves out, and shows that the optimizer builds the same plan from the copied statistics.

Read More
The actual collection of towels is larger than the small hamper suggested

Why Execution Plan Operator Read More Rows Than Available? – Interview Question of the Week #255

December 15, 2019
Pinal Dave
SQL Interview Questions and Answers
Execution Plan, SQL Performance, SQL Scripts, SQL Server

Question: Why Execution Plan Operator Read More Rows Than Available?

Answer: Statistics.

Now let us learn detailed answer in this blog post.

Read More
Previous 1 … 52 53 54 55 56 57 58 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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