Category Archives: SQL Server

SimpleLookups 2.0 Released

Today, I released SimpleLookups v2.0. This version includes the following changes:

New Features:
– Lookup Caching (Enabled by Default)
– Core improvements/optimizations.
– Support for .NET 4.5.1, 4.5.2, and 4.6.

Removed Features:
– Support .NET 2.0 and 3.0.

Version 2.0 is now available on NuGet and on this site. Please install using Visual Studio, if possible. This way, your download counts!

A few links for the lazy:
Getting Started with SimpleLookups

Download SimpleLookups 2.0 | NuGet
View Complete SimpleLookups API Documentation

SimpleLookups 1.6 Released

Today, I released SimpleLookups v1.6.0. This version includes the following changes:

New Features:
– Specify column suffixes for Name/Description/Code/Id columns.
– Specify column name of Active column.
– Specify whether or not to prepend the table name to the column names.
– Core improvements/optimizations.

Version 1.6 is now available on NuGet and on this site. I recommend NuGet, but to each their own.

As typical, a few links for the lazy:
Getting Started with SimpleLookups

Download SimpleLookups 1.6 | NuGet
View Complete SimpleLookups API Documentation

SimpleLookups 1.5.1, Blog Status

Today, I’m releasing SimpleLookups 1.5.1.

This version is a major rewrite of a lot of the core stuff, so it contains no API changes. Basically, if you used it before, it should still work great for you today. The only new thing is that you can now configure it through the app.config/web.config files. The download package contains an example of how to do that, and I’ll be updating the documentation so that it’s even more clear.

You may ask yourself, what happened to 1.5? Well, as of today, SimpleLookups is now available in NuGet. The version had to be revved due to me accidentally pushing an early version of 1.5 during a test, and NuGet not having a way to replace the earlier version (unless the version number is higher). I’m planning to release the next major revision soon anyway, so it’s not a big deal.

Besides the SimpleLookups release, I’m planning to use this site as more of a how-to blog instead of just a release log. I’ve done a couple posts, but I really want to start getting into writing about what I’m learning. The next blog post will be educational, and not a release announcement. Pending bugs of course.

Anyway, keep learning and have a great day. -R

SimpleLookups 1.2 Released

Today, I released SimpleLookups v1.2. This version includes the following changes:

New Features:
– Get a list of lookup values based on a code or a list of codes.
– Remove a list of lookup values based on a code or a list of codes.

Changed Features:
– The methods “GetActive” and “GetAll” are deprecated and are replaced by a single method called “Get”. An activeOnly flag is passed in to the method.

The next release will be v1.5, and it will contain code structure changes and some other changes, namely the ability to configure SimpleLookups through app.config/web.config files.

As typical, a few links for the lazy:
Getting Started with SimpleLookups

Download SimpleLookups 1.2
View Source Code (BitBucket)
View Complete SimpleLookups v1.2 API Documentation

SimpleLookups 1.1 Released

Today, I released SimpleLookups v1.1, which is a small change to the library that is taking the world by storm. (Disclaimer: May not be as popular as advertised.)

This version includes a couple of small API changes, as well as a couple new methods.

New Features:
– Get a list of lookup values based on a list of ids.
– Remove a list of lookup values based on a list of ids.

Changed Features:
– The method “GetById” is now called “Get”.
– The API will now return IList instead of List.

A few links for the lazy:
Getting Started with SimpleLookups

Download SimpleLookups 1.1
View Source Code (BitBucket)
View Complete SimpleLookups v1.1 API Documentation

SimpleLookups 1.0 Released

Today, I released SimpleLookups v1.0, which is a project that I’ve been wanting to release for a long time. This is a small .NET 2.0+ library that is designed to make “lookup” values easy to retrieve from a SQL Server database.

Edit: The tutorial is now here: Tutorial

Download SimpleLookups 1.0
View Source Code (BitBucket)
View Complete SimpleLookups v1.0 API Documentation

SQL Server: Divide Date Range into Months

I wrote a script the other day that is utterly useless to me, but it might be helpful for someone else, so I thought I’d write a quick post about it.

Suppose you have some date range, let’s say “1/20/2013 – 4/29/2014”. Now, suppose you want this range to be broken up into one month sections, with a start and end date for each month. Suppose, for some reason, you want to use a recursive common table expression (CTE). You can just do this:

This would produce the following results:

months-cte-results

I think that this is actually pretty cool, but I can’t really come up with a reason to use something like this, outside of maybe a financial application. Anyway, I hope someone gets some use out of it.