Skip to content

Blog

DbUp: Variable X Has No Value Defined

A quick demo on how schema migrations works in DbUp took an interesting turn as we tried to insert some values into our database:

Beginning database upgrade
Fetching list of already executed scripts.
Executing SQL Server script 'DBMigration.Scripts.Script0004.sql'
Upgrade failed due to an unexpected exception:
System.InvalidOperationException: Variable a4 has no value defined
   at DbUp.Engine.Preprocessors.VariableSubstitutionPreprocessor.ReplaceToken(Match match, IDictionary`2 variables, Match commentMatch) in C:\projects\dbup\src\DbUp\Engine\Preprocessors\VariableSubstitutionPreprocessor.cs:line 62

xUnit.net Cheat Sheet for NUnit Users

I am currently learning the xUnit.net framework as part of a new project I work on. For the last years I used NUnit for my unit and integration tests. Conceptually those two libraries aren't that different. However, the naming of attributes and what is possible in sharing setup & clean-up code makes it worth to take a deeper look.

How to Disable StyleCop for Certain Projects

StyleCop can be a great help to ensure that every developer in a project formats code the same way. However, what is great for production code may not be what you want for your little throw away experiments. Let’s look on our options to disable StyleCop when we don’t need it.

Little SQL Server Tricks: Aggregate Functions on Columns

Aggregate functions (like Min(), Max(), Sum(), etc.) are often used to calculate values in a SELECT statement. Instead of loading all the data and calculate the values for yourself, you let the database give you the answer. That is a lot faster and requires less typing. Aggregate functions are mostly used on rows. But did you know that SQL Server lets you use them on columns as well? This post shows how it is done what could be a simple solution for some tricky questions.

Consolidate the NuGet Packages in your Solution

As a .Net developer you use NuGet packages daily: You add them to projects and can use the functionality they offer without much effort. Adding those packages is one thing, updating them another. Especially with solutions containing many projects it’s common to forget one or another package. There is a simple solution to that problem: Solution wide management of NuGet packages.

Conference Videos: A Widely Underused Learning Opportunity

A great way to learn new things is to attend a conference. You can meet new people, listen to interesting talks and discuss the obstacles one needs to overcome to successfully adopt those new approaches and techniques. However, not everyone has the time to attend a conference or can afford the ticket. A much less costly way to profit from all those learning opportunities is to watch the videos of the talks. Let's look at a few conferences and how easy it is to get those videos.

Running DbUp Inside a Transaction

DbUp is a great tool to manage database migration scripts as I explained in the past. For more than two years we used it in multiple projects and never needed more than the setup example from the documentation. However, in the case of an error this snipped isn’t the best configuration and needs manual work to clean-up your database. Let’s look on the underlying problem and how one can fix it.