You know that you have been doing too much SQL when...

time to read 4 min | 729 words

You write code like this:

public bool IsInPeriod(DateTime dateTime)
{
    bool withinHoursRange = startHour >= dateTime.Hour && dateTime.Hour <= endHour;
    bool matchDayInMonth = dateTime.Day == ( dayInMonth ?? dateTime.Day);
    bool matchDayOfWeek = dateTime.DayOfWeek == ( dayOfWeek ?? dateTime.DayOfWeek);
    bool matchMonth = dateTime.Month == ( month ?? dateTime.Month);
    return withinHoursRange &&
           matchDayInMonth &&
           matchDayOfWeek &&
           matchMonth;
}

Ten points for the first guy that will tell me why this is not good for DBs.

Update: Just to clarify, this is not SQL CLR code, it is an instance method in a business object