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 football goal far across a lawn with a vermilion ball sitting much nearer

Disable Row Goal in SQL Server: When the Hint Helps and When It Hurts

December 28, 2020
Pinal Dave
SQL Performance
Execution Plan, Query Hint, SQL Scripts, SQL Server

To disable row goal for one query, add the DISABLE_OPTIMIZER_ROWGOAL hint to it. This post builds a table where the row goal chooses a bad plan, shows the reads with and without the hint, and then shows a table where the row goal wins.

Read More
all sessions

List All Sessions – SQL in Sixty Seconds #148

December 22, 2020
Pinal Dave
SQL Video
SQL Activity Monitor, SQL in Sixty Seconds, SQL Scripts, SQL Server

One of the most frequent questions which I receive from my client is about activity going inside SQL Server and how to list all sessions.

Read More
Gouache painting of a light wooden cart attached to a small tractor by a vermilion coupling pin

Attach an In-Memory Database With T-SQL: Include the Container

December 21, 2020
Pinal Dave
SQL Tips and Tricks
In-Memory OLTP, SQL Backup and Restore, SQL Scripts, SQL Server

To attach an In-Memory database with T-SQL, use CREATE DATABASE with FOR ATTACH and list the data file, the log file and, when it moved, the container folder. This post builds a demo database, detaches it and attaches it twice. It also shows which rows survive.

Read More
Matched drawer components await fitting beside preserved original materials.

SQL SERVER – Attach a Database with T-SQL

December 18, 2020
Pinal Dave
SQL Tips and Tricks
In-Memory OLTP, SQL Backup and Restore, SQL Scripts, SQL Server

To attach a Database with T-SQL, I use CREATE DATABASE … FOR ATTACH. A customer asked about attaching existing data and log files.

Read More
Gouache painting of a muffin tin holding one seashell in each cup with one vermilion shell

Capture sp_who2 Output Into a Table With INSERT EXEC

December 17, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Monitoring, SQL Scripts, SQL Server, Temp Table

To capture sp_who2 output, create a table with matching columns and fill it with INSERT EXEC. This post builds the table, captures the session list three times with a time stamp, and shows the two errors that stop the method.

Read More
Gouache painting of a leaf under an old brass magnifying glass and a new lens with a vermilion rim

DMV Version of sp_who2: A Cleaner Session List

December 16, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Monitoring, SQL Performance, SQL Scripts, SQL Server

A DMV version of sp_who2 returns the same session details from documented views and leaves out the system tasks. This post builds the query, shows why the old spid above 50 filter fails, and stores the result in a temporary table.

Read More
line numbers

Line Numbers for SSMS Efficiency – SQL in Sixty Seconds #147

December 15, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Server, SQL Server Management Studio

This is when the line numbers in SSMS comes in extremely handy and let us learn in today’s blog post how we can do that. Let us learn today.

Read More
Previous 1 … 32 33 34 35 36 37 38 … 420 Next
  • Books
  • Testimonials
  • Privacy Policy

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