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
Aug20

Immutable Backups: Keeping a Copy Ransomware Cannot Delete

Pinal Dave
SQL Tips and Tricks
DBA, SQL Backup and Restore, SQL Server, SQL Server Security
4 Comments

Design immutable backups with enforced retention, separate storage access, offline recovery material, checksum checks, and restore tests.

Continue Reading
Aug19

Remove Extra tempdb Files in SQL Server Safely

Pinal Dave
SQL Performance
SQL Scripts, SQL Server, SQL Server DBCC, SQL TempDB
2 Comments

To remove extra tempdb files, empty each file first with DBCC SHRINKFILE and then remove it with ALTER DATABASE. This post checks the file count and the allocation waits before you start, rehearses both steps on a demo database, shows the tempdb statements with their undo, and explains why emptying can fail.

Continue Reading
Aug18

How to Create a Table Automatically in All Newly Created Databases? – Interview Question of the Week #238

Pinal Dave
SQL Interview Questions and Answers
SQL Scripts, SQL Server, System Database
3 Comments

Question: How to Create a Table Automatically in All Newly Created Databases? This question was recently asked in my recent consulting engagement

Continue Reading
Aug17

DATETIMEFROMPARTS Function: Build Dates From Parts

Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server
No Comments

The DATETIMEFROMPARTS function builds a datetime value from seven numbers, with no string conversion and no language trap. This post tests how it rounds milliseconds, which parts raise an error, how it treats NULL, and how its relatives build dates, times and offsets.

Continue Reading
Aug16

Runnable Sessions in SQL Server: What to Check Next

Pinal Dave
SQL Performance
SQL CPU, SQL DMV, SQL Scripts, SQL Server
No Comments

Runnable sessions are sessions that have everything they need except a free CPU. This post counts requests by status, checks that SQL Server can see every processor, reads the settings that cap CPU use, and lists the statements waiting in the queue, so a long queue next to a half idle CPU stops being a puzzle.

Continue Reading
Aug15

Shrink tempdb Without Restarting SQL Server

Pinal Dave
SQL Tips and Tricks
Shrinking Database, SQL Scripts, SQL Server DBCC, SQL TempDB
2 Comments

To shrink tempdb without a restart, run DBCC SHRINKFILE against each tempdb file with a target size in megabytes. This post checks the file sizes and the space use first, shows the statement with its undo, and tests the shrink rules on a demo database, so the tempdb server stays untouched.

Continue Reading
Aug14

Show Primary Key of a Table in SQL Server With sp_pkeys

Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Stored Procedure, System Object
1 Comment

To show primary key columns for one table, call sp_pkeys with the table name. This post builds a small demo database, reads a single column and a composite key, and handles schemas and errors. It also lists every key in a database with one catalog query.

Continue Reading
Previous 1 … 152 153 154 155 156 157 158 … 846 Next

SQL Server slow? Let's fix it together in about four hours.

Pinal Dave

In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.

You keep every script, and the know-how to fix it yourself next time.

Want your whole team to learn it?

My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.

Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.


Who We Are

Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.

Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.

Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).


Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.


Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

  • Books
  • Testimonials
  • Privacy Policy

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