Monthly Archives: October 2018

Dynamic PIVOT statement

My attempt to make a dynamic PIVOT statement. The table used is the same as the example in my 70-761 book. First, theĀ @list_of_columns parameter is filled to create a list of columns, using COALESCE. Next a common table expression is … Continue reading

Posted in Uncategorized | Leave a comment

Convert MSDB job history to datetime

This script will get the job history for a particular job. The start time will be converted from integer to datetime. Works for job duration under 1000 hours. Since I’ve still got clients on SQL 2008, I can’t use the … Continue reading

Posted in Uncategorized | Leave a comment