I was asked to retrieve a list of all database backups within the last week. Unfortunately, I forgot about the backupset table within msdb. However, […]
Continue readingCategory: Windows
Windows
Orchestrator – Check for Blank or Null
A good way to check if published data returned from an activity is blank or null is to match against the pattern ^$ (regex for […]
Continue readingOrchestrator – Fail a parent policy based on child status
Set the link from the triggered runbook to fail if the Child policy status equals failed or warning. Succeed if the Child policy status equals success. This […]
Continue readingOrchestrator – PowerShell error handling
We can use the Common Published Data “Error Summary Text” to capture the error from the PowerShell activity. Testing shows that if there are no […]
Continue readingFind the Blocking Job
Sometimes it is useful to find which job is blocking. sp_who2 will show you the running processes, but you will not know which job started […]
Continue readingUse PowerShell to Uninstall an Application – Comparing WMI vs. a Registry Scan
If you have ever scanned the list of currently installed programs using the WMI Win32_Product class, you’ve noticed that the scan runs slow! This always […]
Continue readingPowerShell command to check if a directory exists and if not, create it
I often have to look up this simple PowerShell command. The following command checks if a folder exists and if not, creates it. Works great. […]
Continue readingRename tables, columns, and objects in SQL
I started the New Year renaming some tables and columns to match a new schema. I forgot about a great stored procedure, so wrote this […]
Continue readingQuery for the last SQL database backup date
Helpful to determine when the last database backup occurred. List all databases and the last created date of the backup. SELECT SERVERPROPERTY(‘Servername’) AS [Server Name] ,msdb.dbo.backupset.database_name […]
Continue readingSQL Trace: Duration
A good trace to debug with an sp duration (to limit the results – which can be overwhelming – and check for long running queries): […]
Continue reading