Full documentation on the Undercover Catalogue can be found HERE It's been a while since the Undercover Catalogue last received an update but having had a few of those moments recently when I thought to myself 'I really wish I was capturing that data', so I decided to roll a few changes into the Catalogue.... Continue Reading →
When was my SQL Server Database Last Accessed?
Your boss walks up to you one morning and says, "Hey, I wanna list of all of our databases and when they were last accessed". If you've got some sort of auditing switched on or a trace or xevent catching this sort of info you might be ok, but I'm betting you don't have any... Continue Reading →
sp_snapshot – The easy way to take database snapshots of one or more databases – Version 2.0
Presenting you with an updated version of our sp_snapshot procedure, to easily create database snapshots. This new version adds more flexibility to the procedure, allowing you to specify the snapshot's suffix, add a timestamp and alter the path that the snapshot files are taken to. Parameters @DatabaseList – a comma delimited string of database names,... Continue Reading →
Write to backup block blob device failed. Device has reached its limit of allowed blocks.
Picture this, you're happily backing up your database to a Azure blob storage until suddenly it starts mysteriously failing with the error... Write to backup block blob device https://****** failed. Device has reached its limit of allowed blocks. What's going on, nothing's changed?! Well, it has, the database has grown and the issue that you're... Continue Reading →
Penetration Testing your SQL Server, Part 1 – The Recon Mission
Since witnessing a rather nasty cyber attack around a year ago, I've been thinking quite a bit about security. Do we really know how secure our SQL Servers are? Penetration testing is a great way to find out where our weaknesses and vulnerabilities are. Ideally you probably want to be getting regular pen tests conducted... Continue Reading →
Finding a History of Database Snapshots, Taken and Restored
All code in this post can be found in our GitHub repo https://github.com/SQLUndercover/UndercoverToolbox This is a question that's come up twice this morning, firstly where can we find a history of database snapshots and secondly where can we find a history of restores from snapshot? Frustratingly, SQL doesn't make this at all easy for us... Continue Reading →
Encryption, Comparing your Options in SQL Server
The question of encryption seems to be coming up a lot recently. I've had a number of people asking me about how to go about encrypting SQL Server. SQL can encrypt our data at a number of different levels and gives us a quite a few options when doing so. I want to use this... Continue Reading →
Database Mirroring login attempt failed with error: ‘Connection handshake failed. An OS call failed: (80090302) 0x80090302(The function requested is not supported).
Photo by Pixabay on Pexels.com Here's a quick one for today and is an issue that had me stumped for a while. It's not one that I'd come across before and there isn't really all that much out there on the internet about it. The Issue as I Saw It So, what was the issue?... Continue Reading →
DELETE TOP x rows with an ORDER BY
Photo by Pixabay on Pexels.com This was an interesting question that I was asked yesterday and something that I'd never really thought of before. Can you delete the top x number of rows based on an ORDER BY? Why would you want to do that? Well let's just assume that we have a 'people' table... Continue Reading →
Attach All SQL Datafiles in a Directory
Have you ever had the need to attach a large number of database in one go? There's no way to attach multiple databases in SSMS or via script, so you're probably going to be left with the slow, arduous task of doing them one by one. I recently had to deal with a DR situation... Continue Reading →