With the arrival of SQL Server 2016 we were provided with a new feature in the engine called System Versioned Temporal Tables – typically shortened to Temporal Tables. These tables allow us not only to query the data as it currently is, but also query it at any point in the past too as it […]
Author: Andy B.
Data Engineer and Nerd
This month’s invitation from Camila Henrique asks us for advice we’d give to our younger selves in our T-SQL journey. Coming from the SQL Server perspective there’s a huge variety of areas within the stack where you might want to provide some advice but I’m going to focus on the scripting and querying as that’s […]
Multi-Value Parameters in Reporting Services
Last time out we looked at how to add parameters in a Reporting Services report. In there we looked at adding a parameter where only a single value was selected by the user. We also have the option to allow selection of multiple values for parameters, for example the selection of multiple sales regions or […]
Adding Parameters in Reporting Services
Adding parameters into a report or dashboard you’re publishing with Reporting Services can add that extra shine. It allows the end users to tailor their experience and can allow for the same report to meet different needs. This may require a little extra effort by the developer if you’re looking to go and retrospectively update […]
Dynamic Date Ranges with Window Functions
After recently covering window functions I thought it would be a good opportunity to share one of my favourite use cases for them. The functions for ranking and aggregations have their own clear use cases but here I’d like to discuss a particular use for the LAG and LEAD functions. The scenario There are instances […]
Analytical Window Functions
In the previous posts we covered the ranking and aggregate window functions and this time we’ll be finishing the series covering the Analytic functions, seeing what an alternative to Window Functions might look like, and then wrapping up what we’ve covered in this series of posts. As with our previous examples we’ll set up our […]
Aggregate Window Functions
Last time out we talked about the Ranking options which are available for Window Functions. This time we’ll be covering the Aggregate options which are available to us with them. We’ll also introduce a new feature to see how we can limit the rows the function is performed on, but different to the PARTITION method. […]
Window Functions and Ranking
Introduction Window Functions in SQL Server are functions which can be applied in the SELECT portion of a statement and will return a value relative to other records in the same data set. These functions differ from standard functions such as aggregates where those would combine multiple records together to come up with a result […]
Setting Default Values
Defaulting values is a typical part of data ingestion and processing within SQL. Handling NULL values can cause issues in a number of ways so there are time when we want to get these out of our data. Recently I had a question about setting default values for a field which was being processed as […]
Using Regular Expressions in SQL Server
After being around SQL Server for the last 15 years I was surprised recently to see an example of Regular Expression (RegEx) syntax being used within a SQL query and knew it was something I wanted to try out for myself. What are Regular Expressions? If you haven’t head of them before, Regular Expressions are […]