<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reporting on SQL Server Scripts</title><link>https://www.sqlserver70.com/tags/reporting/</link><description>Recent content in Reporting on SQL Server Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>SQLServer70.com</copyright><lastBuildDate>Mon, 13 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.sqlserver70.com/tags/reporting/index.xml" rel="self" type="application/rss+xml"/><item><title>SQL Server Backup History: Duration and Size Report</title><link>https://www.sqlserver70.com/post/sql-server-backup-history-duration-size-report/</link><pubDate>Mon, 13 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-backup-history-duration-size-report/</guid><description>
&lt;h2 id="query-backup-duration-and-file-size-from-sql-server-history"&gt;Query Backup Duration and File Size from SQL Server History&lt;/h2&gt;
&lt;p&gt;This script queries SQL Server's msdb backup history to report the backup type, start and finish time, duration in minutes, and file size in both megabytes and gigabytes for every backup across all user databases on the server.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Knowing that a backup completed is only part of the picture. DBAs also need to understand how long each backup took and how large the resulting files are. A backup that used to finish in ten minutes now taking an hour is worth investigating. A backup file that is half its usual size may indicate a failed or partial operation. This script, adapted from the DBA-Scripts collection by Bulent Gucuk, joins &lt;code&gt;sys.databases&lt;/code&gt; with &lt;code&gt;msdb.dbo.backupset&lt;/code&gt; and &lt;code&gt;msdb.dbo.backupmediafamily&lt;/code&gt; to surface both duration and size in a single result set. Running it regularly gives you a baseline so that anomalies are easy to spot.&lt;/p&gt;</description></item><item><title>SQL Server Agent Job Failure History Report</title><link>https://www.sqlserver70.com/post/sql-server-agent-job-failure-history-report/</link><pubDate>Sat, 11 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-agent-job-failure-history-report/</guid><description>
&lt;h2 id="report-sql-server-agent-job-status-and-failure-history"&gt;Report SQL Server Agent Job Status and Failure History&lt;/h2&gt;
&lt;p&gt;This script queries the SQL Server Agent job history stored in msdb to produce a detailed report of each job's most recent run status, failure and success counts over the last 60 days, total lifetime run counts, and job step information including subsystem type and proxy name.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;SQL Server Agent jobs automate the critical work of database backups, index maintenance, integrity checks, ETL loads, and more. When a job fails, the impact can range from a missed backup to a halted data pipeline. Knowing which jobs failed, how recently they failed, and whether failures are isolated events or a recurring pattern is essential for any DBA. This script, written by Jason Brimhall and published in the ktaranov/sqlserver-kit community repository, uses a series of common table expressions to build a rich job history report. It shows the most recent outcome for each job status type, counts failures and successes within the last 60 days relative to the latest run, and includes job step details. To report only failures, uncomment one line. Run this script in the context of the &lt;code&gt;msdb&lt;/code&gt; database.&lt;/p&gt;</description></item><item><title>SQL Server Database Size Report for All Databases</title><link>https://www.sqlserver70.com/post/sql-server-database-size-report-all-databases/</link><pubDate>Thu, 02 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.sqlserver70.com/post/sql-server-database-size-report-all-databases/</guid><description>
&lt;h2 id="report-database-size-in-mb-and-gb-for-all-sql-server-databases"&gt;Report Database Size in MB and GB for All SQL Server Databases&lt;/h2&gt;
&lt;p&gt;This script queries &lt;code&gt;sys.master_files&lt;/code&gt; and &lt;code&gt;sys.databases&lt;/code&gt; to report the total allocated size in megabytes and gigabytes for every user database on the SQL Server instance, sorted by largest database first.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="8593449130"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Knowing how large each database is — and tracking how that size changes over time — is a core part of SQL Server capacity planning. Running out of disk space is one of the most disruptive events a DBA can face: it halts log backups, prevents transactions from committing, and can take databases offline. This script, adapted from the DBA-Scripts collection by Bulent Gucuk, reads allocated file sizes from &lt;code&gt;sys.master_files&lt;/code&gt; and joins to &lt;code&gt;sys.databases&lt;/code&gt; to produce a single server-wide size report. It runs from the master database, requires no cross-database queries, and takes milliseconds to execute — making it safe to run at any time, including during a production incident.&lt;/p&gt;</description></item></channel></rss>