Are Stored Procedure Parameters always cached?

By Greg No comments

Does SQL Server always cache your parameters? Does it always keep track of what you pass in?

Default Job History Limits

By Greg No comments

Recently I needed to diagnose why a weekly, multi-step SQL Agent Job was taking so long. I thought, no worries, I’ll go and look at the history to see which step it was. Except…there was no history. Looking at the Job Activity Monitor, I could see that the Last Run was Saturday morning, and the […]

Can I Rollback a Truncate?

By Greg No comments

There’s a common belief that you cannot rollback a truncate statement in SQL Server, but is that true? We can find out with a pretty simple test. First, we need a table we can truncate. Obviously you don’t want to go and try this out on your Production tables, so lets create a test one: […]

Run SQL 2019 in Docker

By Greg No comments

SQL 2019 RC1 is now generally available and I wanted to try it out. Instead of installing it on my PC, I decided to give it a go in Docker. After a bit of mucking around, I worked out the following: Getting SQL up and running took a matter of minutes. You find the docker […]

Create Immediate Messages

By Greg No comments

In SQL, when you don’t want to change the result set, but you want to provide some messages, for example, when debugging a query in SSMS, it can be really helpful to use the PRINT statement. What you’ll start to notice though is that the print statement doesn’t always print straight away. Usually this is […]

SPN for Reporting Services

By Greg No comments

SQL Server Reporting Services uses Windows Authentication to authenticate users when they connect, but it also impersonates the user. Depending on how you’re setup, this often requires the creation of an SPN. SPN’s are awesome when they work, they allow integration with Active Directory, but when they don’t work, it’s a nightmare to fix. Reporting […]

Do you test your backups?

By Greg No comments

So you’ve worked out how often to take your backups, what sort to take, and where to store them. You’ve created your jobs and have them running regularly, now what? Now you need to test that they’re working, and not just now, but forever into the future. There is only 1 way to know that […]

Where to store your backups

By Greg No comments

When you do a backup, whether it be full, differential or log, SQL creates a backup file that you have to store somewhere. You’ll need to decide for yourself where to store your backups based on your requirements for restoring. To work out where to store a backup, we need to work out what we’re […]

How much data can you lose?

By Greg No comments

If you manage data for a business, the biggest risk you should always consider is how much of this data am I going to lose if a disaster strikes? Your manager is always going to want to have 0 data loss, that everything saved is kept no matter how big the disaster. However, they are […]

Types of SQL Backups

By Greg No comments

SQL Server has 3 different types of built-in backups: Full, Differential and Log. When working out how you’re going to backup your database, you need to understand what the 3 different types are intended for, so you can work out what you need to do. Full A full backup is the simplest type to understand […]