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 →
Concatenation Truncation – Are your strings being truncated?
It wasn't until recently that i paid attention to truncation during concatenation, but that's because whenever I used concatenation before it was only using short data lengths so I didn't see the effects of truncation. When I first noticed that truncation can occur I was building a Huge piece of dynamic SQL , Don't... 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 →
7 ways to Query Always On Availability Groups using SQL
There are multiple ways to query availability group information, below are some of my favourite goto queries when I need to obtain information about Always on Availability groups for various tasks. Show All availability groups visible to this server where this Server is the Primary replica Show All availability... Continue Reading →
Duplicate Agent jobs – A good reason not to meddle with Msdb
Some time ago I came across a strange issue where I found a number of duplicated SQL Agent jobs, the odd thing is SQL will not allow you to have more than one agent job with the same name - they need to be unique. To demonstrate here is an example of what i... 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 →
Building an IN list using REPLACE
Have you ever had the need to build an IN list from some rows you had in excel? Or maybe you have a bunch of data you pulled out of a results set from some other server somewhere and you are unable to join tables so you need to plug the values into an... Continue Reading →
