Here is a little script that gives an overview of your current ONLINE databases, their data and log File names, sizes and growth rates - if the growth rate is a percentage it will calculate this for you so that it is represented as a value in MB in addition to showing you the Percentage... Continue Reading →
Who’s Updated My Rows?! Interrogating the Transaction Logs
I'm pretty much positive that we've all been here at one time or another. We're sitting at our desk watching Klaus' latest SQL Quickie when a red faced colleague comes marching up to our desk and splutters out, in their rage "Someone's updated all my rows, can you find out who did it?". Now usually,... Continue Reading →
Restores using Invalid Backup Default Locations
Recently I was looking through the error log on one of my test machines and I spotted some unusual errors: SQL ERROR: 3634 - The operating system returned the error '3(The system cannot find the path specified.)' while attempting 'DeleteFile' SQL ERROR: 18272 - During restore restart, an I/O error occurred on checkpoint file... Continue Reading →
UNDERCOVER TOOLBOX: Generate a Temporary Table Definition to Match the Resultset of a Query
Have you ever needed to store the results of a complex query in a temp table? How did you go about working out what the definition for that temp table should be, the columns and their data types? It can be a bit of a pain, not to mention time consuming to have to go... Continue Reading →
UNDERCOVER TOOLBOX: sp_ChangeDatabaseOwnership – Producing statements to Alter Authorisation
The latest addition to our toolbox is not a one size fits all, this procedure may or may not suit your needs but if you have a requirement of setting database ownership's to a specific login across the board such as SA, then this Stored procedure may well be for you. The idea of... Continue Reading →
View your Failover Cluster from the DMV’s
Just a quick post this time , I was fumbling around the DMV's the other day looking for a specific Availability group DMV that I just couldn't remember the name of - I think we have all been there before with some of the DMV names! 🙂 Whilst I was combing through various combinations of... Continue Reading →
SSMS- Source Database ‘Restoring’ After Performing a Restore To a New Destination
"I just tried restoring a copy of my database but now the original's in recovery" That was the panicked question that I was asked earlier today and as it's something that I've seen come up more than a couple of times, I thought I'd write up a lunchtime quickie to explain the issue. If you... Continue Reading →
UNDERCOVER TOOLBOX: Sp_RunningJobs – See all currently running SQL Agent Jobs
Update: 07/08/2017 - Identified and fixed a bug with the Elapsed Days not showing accurately. Update: 31/7/2017 - We have improved the Stored Procedure, the revised version now includes Days elapsed in addition to Hours, Minutes and Seconds. There are quite a few Running agent job scripts out there , most of the ones I... Continue Reading →
sp_RestoreScript v1.1 Now Available
Holy Database Restores Batman, sp_RestoreScript 1.1 is now available in the Undercover Toolbox and at UNDERCOVER TOOLBOX: sp_RestoreScript – A Painless way to generate SQL Server database restore scripts. This update fixes an issue that we've found when running on SQL Servers prior to 2016.
Secret Codes And SQL Server, Part 2: Pimp Your Encryption Algorithms.
We had a little play around writing our own encryption algorithms and cracking them in Secret Codes And SQL Server, Part 1: Writing Our Own Encryption Algorithm and Cracking it. I thought I'd see if we can go a step further and start having a look at how we could take those basic ideas and try... Continue Reading →
