So this month's T-SQL Tuesday subject is a shout out and high-five to those people who have inspired or made a contribution to my DBA life. Well where do I start? Thinking back on my career there are just so many people that have given me a push here and a nudge there without which I... Continue Reading →
UNDERCOVER TOOLBOX: Using Python To Copy A SQL Login From One Server To Another
Recently I've been thinking about Python and whether it can be useful to the DBA as well as the data scientist. One good use that I have found for it is to copy logins from one server to another. There are plenty of times when you might want to copy your SQL logins (including the... Continue Reading →
Connecting to a Remote Instance of SQL Server Using Python
SQL Server's integration of Python has been heavily marketed towards the machine learning and BI guys, but does it offer anything for the DBA? All the attention has been on machine learning, so much so that for a while I didn't pay it any attention at all, but then I got thinking to myself. DBAs... Continue Reading →
Failed to perform AlwaysOn Manual Failover using the wizard – Availability-group DDL Operations are permitted only when you are using the master database .
Routine maintenance rolls around and it's time to failover your AG's to new Primary's to allow for patching and restarts... the weapon of choice will be the SSMS Failover wizard - and why not its does the job nicely and give us some nice visuals as it progresses through each failover. On this... Continue Reading →
Copying Data From One Table To Another – To Disable Indexes or Not To Disable Indexes, That’s the Question.
As the famous Bard once said, "To disable indexes or not to disable indexes, that is the question?". Well maybe that wasn't quite what he said but it was a discussion that came up here just recently. We've found ourselves inheriting a process that has to copy all the data from one database into another,... Continue Reading →
UNDERCOVER TOOLBOX: sp_Snapshot – The Easy Way To Create Database Snapshots for One or Many Database
This post refers to an older version of this procedure. Please see HERE for the latest version. sp_Snapshot is a procedure that we've written to quickly and easily create a database snapshot of one or multiple databases. Prerequisites sp_Snapshot uses STRING_SPLIT, if you're running on a version of SQL Server prior to 2016 or have... Continue Reading →
UNDERCOVER TOOLBOX: Checking Your Backup Paths Exist and Automatically Creating Them if they Don’t
Where do you send your backup files? Here at SQLUndercover, we like all our databases to have their own backup folder, it just makes it nice and easy to find things. But what happens if someone creates a new database but doesn't create a backup folder for that database? Unless you're doing some kind of... 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 →
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: When was my last backup taken?
One question that seems to come up on the forums again and again is, 'how can I see when my database was last backed up?'. There are always a bunch of answers and some very convoluted scripts thrown around. As a bit of a lunchtime quickie today I thought I'd share with you a script... Continue Reading →
