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 an antique sewing machine beside two spools whose threads form a tight vermilion knot

NOLOCK Without WITH: Table Hint or Table Alias?

October 24, 2017
Pinal Dave
SQL Performance
Compatibility Level, Query Hint, SQL Lock, SQL Scripts

NOLOCK without WITH and without parentheses is not a hint, because SQL Server reads it as a table alias. This post proves it with a lock test, shows why the compatibility level doesn’t change it, and gives a query that finds the bad syntax in your code. It ends with the safer ways to write the hint.

Read More
SQL SERVER - Error Due to Database Context - Error 208 - Invalid Object Name

SQL SERVER – Error Due to Database Context – Error 208 – Invalid Object Name

October 23, 2017
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server, SQL Server Management Studio

Stuck on Error 208, Invalid Object Name, in SSMS? Often the object is fine and you are simply in the wrong database. Here is how database context causes it.

Read More
A thicker ledger card has moved to a second shelf, with a forwarding string left at its original slot

What are Forwarded Records in SQL Server? – Interview Question of the Week #145

October 22, 2017
Pinal Dave
SQL Interview Questions and Answers
Clustered Index, SQL DMV, SQL Index, SQL Scripts, SQL Server

What are forwarded records in SQL Server? It is an old concept, yet few new DBAs know it. Here is a short answer about heap rows that moved to a new page.

Read More
Gouache painting of a small tent beside a large open-sided vermilion canopy over a picnic table

Create a Global Temporary Table in SQL Server

October 21, 2017
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL TempDB, Temp Table

A global temporary table starts with two # signs, lives in tempdb, and any session can read it. This post creates one, reads it from a second window, and shows when SQL Server drops it. It also covers name collisions and the cases where a different table type is the better choice.

Read More
Gouache painting of a leaning stack of paper cups beside a tray holding one vermilion mug

Optimize for Ad Hoc Workloads: When to Turn It On

October 20, 2017
Pinal Dave
SQL Performance
Ad Hoc Query, Execution Plan, SQL Cache, SQL Memory

Optimize for Ad Hoc Workloads shrinks the memory that one-time queries take in the plan cache. This post builds a demo of single-use plans, measures their share of the cache, and shows how to read the result. It also covers the cost of the setting and why parameterized queries are the better fix.

Read More
Gouache painting of a path of stepping stones with one worn stone and a vermilion hourglass beside it

Stored Procedure Execution Count and Average Elapsed Time

October 19, 2017
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Scripts, SQL Server, SQL Stored Procedure

To find a stored procedure execution count, query sys.dm_exec_procedure_stats and divide the total elapsed time by the count. This post builds a demo, shows the query, and explains why the numbers start again when a plan leaves the cache. It also fixes the object name lookup that returns NULL for other databases.

Read More
Two temporary tile workspaces have different physical boundaries and one tile in each.

SQL SERVER – How to Create Table Variable and Temporary Table?

October 18, 2017
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL TempDB, Temp Table

A Temporary table uses CREATE TABLE, while a table variable uses DECLARE. I use one row in each beginner example.

Read More
Previous 1 … 245 246 247 248 249 250 251 … 844 Next
  • Books
  • Testimonials
  • Privacy Policy

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