The T-SQL method to find the active node that a SQL service is running on:…
Month: March 2016
SQL Jobs – Daylight Savings Risks
For those of us not lucky enough to live in Arizona (where daylight savings is…
Validate SQL Code Without Running It
Validate SQL Code Without Running It In a nutshell: SET NOEXEC ON; — The script…
SSMS Scripting Partition Scheme With Correct Filegroup
I almost found a bug… but it’s a feature after all. If you are scripting…
AdventureWorksDW Databases – 2012, 2008R2 and 2008
AdventureWorks sample databases seem to be so hard to find when you want them. Here’s…
Database File Space and Free Space
/* Author: Ben Farnsworth Date: 1/7/14 Get info on Data files */ IF OBJECT_ID(‘tempdb..#space’) IS…
Autogrowth On But Database Not Growing
An issue arose where a database was giving the error: Could not allocate space for…
Shrinking Database Files With Excess Free Space
This script is intended for environments where space constraints require the space to be closely…
SQL Server – Lots of Empty Space But Database Won’t Shrink
Today I ran a script to delete a huge portion of data in a DEV…
SQL Server – Get Latest Backup File Sizes For All Databases
This returns a result for each database and includes its size in MB. SELECT DATABASE_NAME…