There are occasions when testing TSQL that we only need a small amount of input data and do not want to go through the hassle of creating, populating and then deleting tables. A nice quick solution is generating dynamic data through a Common Table Expression (CTE). Take a look at the following code. WITH CTE … More TSQL Tips – VALUES in FROM Clause
If you have a multi-layered application you may want to keep the file and assembly version numbers of all the assemblies the same. This would entail editing each AssemblyInfo.cs file. An alternative is to create a single file holding the versions and referencing it from each projects. Let me show you how. Imagine the following … More Visual Studio – Synchronize a Version Number across Multiple Assemblies
How many times have you just thrown something together, put it in the wild, expecting to never hear from it again and then five years later you get an email with this in it. Oh, just me then. In this instance it was a fix for Excel 2010 and I thought it was not used … More Five year old piece of code suddenly fails.
There are times when you create an assembly executable that has dependencies on other assemblies. You may want pass this assembly around without having the need for it to be installed however; if you have to copy DLL’s around with the EXE, there could be a chance that they are forgotten or the wrong versions … More Embedding .NET Assemblies inside .NET Assemblies
The TRY/CATCH/FINALLY exception handling has been around since C# 1.0 and you are very unlikely to find a developer who does not know how to use them. What may not be so obvious is that there are a number of hidden gems that few developers use. This is on top of new enhancements that have … More C# Exceptions – Hidden Gems
Developing TSQL summary reports by some variation of date is a very common requirement. Therefore having a library of date expressions is very useful. Below are a group of the common expressions I use. First and Last Day of the Previous Month SELECT CAST(GETDATE() AS DATE) AS [Today], CAST(DATEADD(dd, -(DAY(DATEADD(mm, 1, GETDATE()))-1), DATEADD(mm, -1, GETDATE())) … More TSQL Tips – Useful Date Calculations
A colleague of mine asked me what the protocol_version column represented in the DMV sys.dm_exec_connections and whether it was useful in anyway. The Microsoft documentation does not help too much. It is actually the version of the TDS Protocol used between client and server. When a client connects to SQL Server, as part of the … More SQL Server – sys.dm_exec_connections.protocol_version
I use Visual Studio Team Service (VSTS) as part of my DevOps process for end to end Continuous Integration (CI) and Continuous Delivery (CD). As the product grows so does the number of built in variables and whilst the documentation explains the variables you have available, understanding what the values are can be tricky. At … More Visual Studio Team Services – Dumping out Build and Release Variable Values