blog
My blog of techy stuff, ranging around SQL (SQL Server, that is), C# and .net, JavaScript and a smattering of stuff about the Orchard CMS (that powers my site) as I get more familiar with it. There's the occasional non-technical post when something is of interest to me that I feel is worth sharing, but they should be few and far between
-
Calling ASP.NET Web API end-points for testing purposes
I'll preface this by saying there are almost certainly a bucket load of different tools and twice as many supporting libraries / packages out there that'll give you a solution to this problem but …
-
Using ROW_NUMBER to get the most recent record from a table
Quite a while ago I wrote about using SQL Server CLR to add "earliest" and "latest" aggregate functions that could be used to retrieve the, well, earliest and latest Id values from a table based on …
-
Stopping and starting a System.Timers.Timer - be careful you don't stop forever!
I've sometimes seen code that stops and starts a timer during its TimerElapsed event in order to ensure that the event isn't called whilst it's still being executed from a previous call. If this …
-
Using the CommandLineParser NuGet package to handle your command line
From time to time I've needed to write small console apps that accept parameters via the command line. Luckily, parsing the command line is a solved problem and there are multiple libraries out …
-
Making sure Windows doesn't start your service before SQL Server
This is more of a "note to self" of the syntax, but, if you have a service that depends on another (such as a local SQL Server instance for local logging) then you can tell Windows about that …
-
Finding the process template for a your TFS 2015 projects
If you're trying to determine what Process Template was used when the projects in a given TFS project collection were created, the quickest way to do this that I've found is to run the following …
-
What's an Estimated Subtree Cost?
When you're looking at the execution plan for a query (you do that, right?) one of the data-points that's shown is "Estimated Subtree Cost". Looking at this is one of the things I review when I've …
-
Getting a 403.501 error response from IIS? Check your 'Dynamic IP Restriction Settings'
One of the applications I inherited is composed of multiple applications and uses one of them as a central authentication solution (issuing tokens on login, refreshing them, revoking them, etc,..) …
-
Using the AngularJS 'ng-required' attribute to make fields co-dependent
One of the bugs I had to fix recently was around ensuring that if Field X was populated, then Field Y became required. In the example I was working with this was all the more complicated due to …
-
Creating a linked server that has a different name to the "real" server
It's sometimes useful to be able to have a linked server where the name is misleading. One example of this could be where you don't have a perfectly isolated test or staging infrastructure so you …