Leap Year

A leap year can be calculated using a formula (Please see Microsoft article), however there is no real need to calculate it this way. All that is needed in sql…

Last Backup Occurred

This script will show when the last backup occurred as well as the backup type for each database. This covers all the backup types available and pivots the output into…

Get-VolumeFreeSpace

Here is an example function to return free space remaining on a volume with associated details. Updated 27/04/2012 to fix mount points. Usage Examples: Get-VolumeFreeSpace|ft Get-VolumeFreeSpace|Select ComputerName,Name,MountPoint,FreeSpaceGiB|ft Get-VolumeFreeSpace|Where-Object {!$_.SystemVolume}|Select ComputerName,Name,MountPoint,FreeSpaceGiB|ft…

Dell Service Tag

  The Dell soap API now returns a HTTP Error 503. The service is unavailable so the code listed below no longer functions. Dell provide an alternative method to retrieve…

First day of the week

Given a particular date how do you determine the start date of that week? But more importantly what is the start of the week? The first column returned in the…

Get-DatabaseSizes

Simple example using SMO to get database storage information. You will need SMO installed for this script to work. Note Size relates to the file size on disk, where as…

Coalesce vs ISNULL

The difference between ISNULL and COALESCE? It is quicker to type ISNULL. Plus COALESCE always takes me a few goes to spell correctly, luckily there is intellisense and I can…

SQL Events 2013 Part 2

Just to make everyone aware that SQL Relay is back in November this year. These are all day events, and well worth attending. The link you will need is: http://www.sqlrelay.co.uk/register.html The…