2019-12-30

UNION vs. UNION ALL in SQL Server

I really dislike database queries which are slow for no apparent reason. I ran into one of those today. It queries over a few thousands of well indexed rows and returned a handful, perhaps 3, records. Time to do this? 33 seconds. Well that’s no good for anybody. Digging into the query I found that it actually used a UNION to join 3 sets of similar data together. I go by the rule of thumb that SQL operations which treat data as sets and do things with that in mind are efficient. I’m not sure where I read that but it has stuck with me over the years. What it suggests is that you should avoid doing things like looping over rows or calling functions on masses of data.

As it turns out there are actually two different UNION operators in SQL Server: UNION and UNION ALL. They differ in how they handle duplicate entries. UNION will check each entry to ensure that it exists in the output only one time.

Read More

2019-12-05

Machine Learning for Boring Applications

C# Advent

This post is one among many which is part of 2019’s C# Advent. There are a ton of really great posts this year and some new bloggers to discover. I’d strongly encourage you to check it out.


If you read at all about the myriad of applications for machine learning you’ll find that there are a lot of people out there building really cool stuff. Cars which drive themselves. Things which write tweets based on an AI’s interpretation of thousands of tweets about venture capitalists. Unfortunately I, like a lot of developers, earn our bread and butter by writing what is mostly boring forms over data applications. This is a space in which there is 0 application for machine learning. Or is there?

Read More

2019-10-12

Bulk Load and Merge Pattern

The more years you spend programming the more you run into situations you’ve run into before. Situations you now know, instinctively, how to address. I suppose this is “experience” and is what I’m paid the medium dollars for. One such problem I’ve solved at least a dozen times over the years is updating a bunch of data in a database from an external source. This, as it turns out, can be a great source of poor performance if you don’t know how to address it. Let’s dig into my approach.

Read More

2019-07-03

Debug PHP Inside A Container with VSCode

Sometimes good things happen to bad people and sometimes bad things happen to good people. I’ll let you decide which one me developing a PHP application is. Maybe it is a bit of a mixture. This particular PHP app was a bit long in the tooth (what PHP app isn’t) and ran on full VMs. My first operation was was to get it running inside a docker container because I couldn’t be sure that my Windows development environment would be representative of production, then I wanted to be able to debug it. This is the story of how to do that.

Read More

2019-05-23

Azure DevOps Terraform Trouble

I’m a big fan of Azure DevOps and also of Terraform. I use the Terraform tasks to run deployments of infrastructure in a DevOps pipeline. Today my old reliable build broke because of a change to the version of Terraform.

Read More

2019-05-15

Unable to cast object of type Microsoft.XrmSdk.Entity

You’ll likely encounter early bound types when developing workflows, plugins or anything else which calls the Dynamics 365 SDK. These are basically generated classes which come from Dynamics. You can generate them using the CrmSvcUtil.exe. If you’ve ever done anything with T4 templates you can think of them as that or a really poor substitute for F# type providers.

Read More

2019-05-13

Running MiniKube on an Azure VM

MiniKube is a Kubernetes distribution designed to make running a single node Kubernetes cluster easy for local development. However MiniKube relies on docker which relies on you having a Professional version of Windows on your laptop. If you don’t have that then it is really easy to stand up an Azure VM which can run MiniKube.

Read More

2019-04-05

Add records to Dynamics 365 from PowerShell

Dynamics 365 is a low code solution for a variety of different businesses offered by Microsoft. It is a fully hosted solution which means that you don’t really get access to the underlying database. That’s a good thing (less to manage) but also a bad thing (hard to work with for power users).

In this post we’ll look at how to manipulate records in the CRM using some powershell.

Read More

2019-02-17 |

Durable Functions Analyzer

When it was announced the Roslyn would become the default compiler for C# in Visual Studio I was super excited. I felt like it would generate all sorts of domain specific languages, custom flavors of C#, tons of custom error providers. So here we are 5 years later and almost none of it has come to pass. Why not?

Read More

2019-02-14

Durable Azure Functions vs. NServiceBus Sagas

I’ve been on a bit of an Azure Functions kick over the last little while. I’ve blogged a bunch on Durable Functions and deployed a bunch more. When you’re as old as me then you tend to draw comparisons between new technologies and existing ones. For instance I’m constantly telling people about how web pages are a lot like the cave paintings I use to do in my youth.

The Twitter Exchange

The technology that draws the closest comparison I’ve seen to Durable Functions are NServiceBus Sagas. A few weeks ago I tweeted out wondering if any body had done a comparison. The good folks at Particular stepped up and answered.

Read More