Categories
SQL

Utilising Bit Masks with Bitwise Operators

A few weeks back we looked at options for storing multiple boolean flag values in a table. One of the options we considered was the use of a Bit Mask where we packed multiple flags into a single field. When we have individual fields within a table, using and manipulating those is straightforward. However when we’ve got […]

Categories
SQL

Designing Long Running Procedures for Maintainability

Whilst we have front-end code which requires faster response times, there are also times we build code with the purpose of running for extended periods of time. Examples of this could be maintenance routine, or custom built queuing mechanisms. The way in which we design longer running processes like this can be key when it […]

Categories
T-SQL Tuesday

Belated T-SQL Tuesday #165 – Data Jobs Roles

Well I’m a little late to the party this month, I got my weeks mixed and was only reading about this month’s T-SQL Tuesday as the community was posting their responses. So here we go, finally. This month’s ask from Josephine was to consider our understanding or expectations from data job roles. When we see […]

Categories
SQL

Calculating String Lengths

We store a wide variety of data within our platforms, some of which will inevitably be string based. Along with that comes a need to perform manipulation of those strings. When slicing, combining, or manipulating strings one element which we need to consider is the length of the string. Here I wanted to have a […]

Categories
SQL

Recursive Functions and Limitations

When writing functions within SQL Server we sometimes have need to repeat an action multiple times until a given condition is met – also known as Recursion. There are a couple of common ways which this can be implemented which also have their different limitations. A little about recursion Firstly, why do we need recursion? […]