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
-
Using Microsoft.Build.Traversal in lieu of solutions for building your projects
Somewhere recently I came across a reference to the Microsoft.Build.Traversal SDK which has been sat in an open tab in my browser ever since. Traversal:
Supports creating traversal projects which …
-
Fixing up the archive counts in Orchard
For reasons best known to itself, sometimes Orchard gets a little count happy with the number of posts in a given archive year/month and over exaggerates the number of posts present. Fortunately …
-
Don't use 'SET DATEFORMAT' and don't manipulate dates as strings
There are two things that're a bad idea when it comes to dates and SQL Server (that I'm blogging about right now, there are surely many more than that!), using 'SET DATEFORMAT' to alter the default …
-
Using the new Microsoft Library Manager to Bootstrap a project
The latest release of Visual Studio 2017 (15.8) comes with Microsoft Library Manager, or LibMan for short, there's also a CLI available and if you want to read about it from the horses mouth …
-
Using Common Table Expressions to explode recipes - Part 2 - Getting the ingredients
A Brief Recap
In the last part of this article I showed a table structure for recipes and their ingredients. There are two kinds of ingredients that a recipe can contain, raw ingredients (e.g. …
-
Using Common Table Expressions to explode recipes - Part 1 - The CTE
A lot of the examples that you see for using Common Table Expressions (CTEs) in SQL Server, particularly recursive ones use examples that are around user hierarchies - showing ways to find all the …
-
Using Sequence Numbers in SQL Server
Microsoft introduced the concept of Sequence Numbers in SQL Server 2012 which are:
... a user-defined schema-bound object that generates a sequence of numeric values according to the specification …
-
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 …