Column name or number of supplied values does not match table definition

I came across this familiar error recently when writing some scripts. Normally I see this error when doing an insert, and the number of columns you've specified doesn't match the number of values you've provided. But this time it was in an UPDATE script. Here's the script: When this runs it gives an error Column …

Asking for Help

I always think it's a great idea to ask for help. When I was a kid, my parents taught me that it's always a good idea to ask for help - the worst that will happen is they'll say no. In IT there is too much to learn so I always think it's a great idea …

Cleanup Backup History

While looking at long running queries today I noticed that one of our worst performing queries was a monitoring tool that checked when the last backup ran. SELECT database_name = DB_NAME(DB_ID([database_name])) ,         type = [type] ,         backup_start_date = MAX([backup_start_date]) ,         backup_finish_date = MAX([backup_finish_date]) FROM    msdb..backupset WHERE   DB_ID([database_name]) IS NOT NULL GROUP BY DB_NAME(DB_ID([database_name])) ,[type] I had …