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 garage half full of stacked flower pots and half cleared, one stack vermilion

sp_delete_database_backuphistory: Prune msdb Backup History

June 5, 2023
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, System Database

The sp_delete_database_backuphistory procedure removes the backup and restore history of one database from msdb, and sp_delete_backuphistory does it by age. The demo counts the rows of a database before and after the delete and previews the delete by age. The last sections explain how to keep the history small.

Read More
A rotating shoe carousel with shoes grouped by their different shapes

Counting Objects by Type in Every Database With One Query

July 6, 2021
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Sample Database, System Database

One loop and one pivot give you tables, views, procedures and functions for every database. A planted demo database proves the counts.

Read More
SQL Server VSS backup sequence: freeze writes, take snapshot, then resume writes. Investigate if the pause persists.

SQL SERVER – What do These Messages Mean – “I/O is Frozen on Database” and “I/O was Resumed on Database”?

March 14, 2020
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Error Messages, SQL Server, Starting SQL, System Database

  “I/O is frozen on database” and “I/O was resumed on database”? Did you check the air conditioner temperature? Let us learn about it in today’s blog post.

Read More
Gouache painting of a row of hourglasses of different sizes on a windowsill, some with vermilion sand and some with pale sand

SQL Job Schedules: Read Every Schedule in Plain English

January 31, 2020
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Server Agent, System Database

SQL job schedules are stored as codes, and even the built-in description shows a time such as 60000. This post builds four demo jobs with five schedules and decodes every one with a single query. It also shows shared schedules, disabled schedules and jobs with no schedule at all.

Read More
Title card: Script Level Upgrade for 'master' Failed

SQL SERVER – Script Level Upgrade for Database ‘master’ Failed – The Server Principal Owns One or More Availability Group(s) and Cannot be Dropped

January 14, 2020
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, System Database

In this blog we would learn about fixing error Script level upgrade for database ‘master’ failed because of upgrade step ‘’msdb110_upgrade.sql’

Read More
Plain parcels waiting above a chute while one parcel rests at the outlet

Database Mail Health Check: Unsent Items and the Event Log

September 11, 2019
Pinal Dave
SQL Tips and Tricks
Comprehensive Database Performance Health Check, Database Mail, System Database, Transaction Log

The alert job succeeded, yet nobody got the email. Here are three read-only checks that show whether Database Mail is really working.

Read More
A carved template produces the same pattern on several new clay tiles

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

August 18, 2019
Pinal Dave
SQL Interview Questions and Answers
SQL Scripts, SQL Server, System Database

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

Read More
1 2 3 4 … 6 Next
  • Books
  • Testimonials
  • Privacy Policy

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