logo

String or binary data would be truncated

This, in my opinion, is the most frustrating error you can get in SQL Server. It’s the error you get when you’re trying to do an "INSERT INTO (…) SELECT (…)" to push a bunch of records from a query result into a table. If one of your (n)varchar fields is too small to hold one of the values, you get this lovely error. It’s nice that SQL Server won’t truncate your fields for you, but frustrating that you get this sad little error with no details.
3 minutes to read

Bad cache

We had some code break down today. Here’s the story. One of the great tricks in the object oriented world is late bound variables. When it’s expensive to initialize a variable, or you’re not sure you’re going to always use it, you don’t initialize it until first use. Public Readonly Property Something() As SomeObject Get If _someObject Is Nothing Then _someObject = DoExpensiveInitialization() End If Return _someObject End Get End Property Private _someObject As SomeObject Another great trick is caching data.
3 minutes to read