What’s Next?

By Greg 2 comments

Over the last 15+ years as I’ve learnt more and more about SQL Server, I have come to realise how much I love working with it. The more I dig into it, the more I see a need for companies to understand how to keep their data secure, how to keep it available, and how […]

Recording of Adding Commas to Missing Index Requests in sp_BlitzIndex

By Greg No comments

I did some work on sp_BlitzIndex recently. Check out the clip on YouTube:

CTEs are not Staging Tables

By Greg 1 comment

If you have a complex query, a CTE (Common Table Expression) can be a great way to break down the query into individual parts. What is often overlooked by developers is that CTEs can cause significant performance problems when used incorrectly. A common pattern I have seen is joining to a CTE multiple times. This […]

Option Recompile

By Greg No comments

When doing query tuning, sometimes the answer can be that it’s just better to get SQL Server to recompile a plan based on the data passed in. You might have a batch process that runs every hour and sometimes it has only a few hundred rows, other times it has a few billion rows. The […]

Change the Schedule of a Clustered Scheduled Task

By Greg No comments

In a previous post, I showed how you can create a clustered scheduled task. Now we could use that trick to change the schedule of a scheduled task by deleting and then importing a new one, but wouldn’t it be better to just change the schedule? Using PowerShell, this is quite simple. First, connect to […]

Redundancy for Scheduled Tasks

By Greg 6 comments

Do you use Scheduled Tasks as part of your production environment? Maybe to run those end of month reports for finance, or to run a nightly batch process, to import data from some uploaded flat files, or to download data from an external source on a regular interval. Scheduled Tasks are a really simple way […]

Sysadmin in SSRS doesn’t have access to view reports

By Greg No comments

Short and simple post this week. When setting up a Reporting Services Server this week, I added a user as a SysAdmin as they should have full access to the server to maintain it in the future. After setting up the user they tried to click in to the end of month reports folder…and couldn’t […]

Rollup and Cube Part 3

By Greg No comments

In the previous 2 posts we have looked at how Rollup and Cube work. This time we’re going to look at how you might implement these in the real world. I don’t think ROLLUP has a great use in the real world (feel free to comment below if you have a real use for it). […]

Rollup and Cube Part 2

By Greg No comments

Previously in Part 1, we looked at the ROLLUP keyword that can be applied to SQL Select queries. We are now going to look at the similar, but different CUBE keyword. As we saw last time, the ROLLUP keyword would sum each part of the GROUP BY and give you a running total. The CUBE […]

Rollup and Cube Part 1

By Greg No comments

I have recently come across these 2 keywords: ROLLUP and CUBE. These keywords allow you to get running totals when you group by some data. In this post we’ll have a look at how ROLLUP works, and in the next post we’ll see how CUBE works, and then in the final post we’ll look at […]