Here's a little something that came up the other day, we've got a couple of tables which we need to join together but there's no common key to join on. How do we go about attacking this? As an example consider the following, we've got two comma delimited strings that we need to join together.... Continue Reading →
Generating Random Numbers For All Rows in a Query and Other Funky Stuff You Can Do With Them
UPDATE: Check out Generate a Random Number for Each Row in a Query {a better way} for an alternative method that I now use for generating random numbers using CRYPT_GEN_RANDOM Here's a lunchtime quickie for you all, this is something that I've seen asked on the forums plenty of times and always gets some quite... Continue Reading →
Database in ‘Recovery Pending’ After Transaction Log Backup
Here's a little issue that I came across last week and I thought I'd share my investigations with you. Users started to report that a database was inaccessible and when I had a look, sure enough the database was in 'recovery pending' state. That's odd, a database usually only goes into 'recovery pending' state at... Continue Reading →
UNDERCOVER TOOLBOX: fn_SplitString, It’s Like STRING_SPLIT But For Luddites (or those who haven’t moved to SQL 2016 yet).
When Microsoft announced STRING_SPLIT, cries of joy and jubilation could be heard all around the offices of SQL Undercover. For those of you who aren't aware of this miracle of the database world, we've finally got a way of converting a delimited string into a table. If you've ever written a proc or script where you... Continue Reading →
The dreaded SQL server error 3013! ‘RESTORE LOG is terminating abnormally’ the bane of my life, until recently
The dreaded '3013 - RESTORE LOG is terminating abnormally' message! the bane of my life, until recently... So I find myself looking through our automated backup restore job history, and i see a bunch of the '3013' errors and I am wondering what on earth is going wrong here, this could be anything! The error... Continue Reading →
DBs in the Cloud Part 1 – Setting up and Connecting to a SQL Azure Database
Unless you've been living under a rock for the last few years I'm sure that you've all heard of that mystical world that is Azure and some of us may even know people who have visited that land but how do we get there ourselves? Well don't worry my fair database folk, there's no need... Continue Reading →
