LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

Book Review – NHibernate 3.0 Cookbook

I just finished reading the NHibernate 3.0 Cookbook, part of Packt Publishing’s Open Source series, and I’ve been really impressed. The book is written by Jason Dentler, whose blog I’m sure anyone doing frequent searches for NHibernate has run across once or twice in their travels. What really stood out to me about this book was how easy it was to read. You can tell that Jason went out of his way to make the book approachable for people unfamiliar with the concepts (without dumbing down the content) and in my opinion it really paid off.

Read More...

Picking a science fair project

When school started this year, my 7th grade daughter was informed that she is expected to complete a science fair project. I plan on convincing her to post her final report as a blog on this site, but it’s not scheduled to be completed for a couple more months. I plan on writing a series of blogs outlining the steps involved from a parents’ perspective. Step 1: Picking the project.

Read More...

Unit Testing Costs Too Much

There is a long list of reasons not to use Unit Testing in your current projects. In fact I was able to make such a long list of reasons not to use automated Unit Testing that I wasn’t able to use them all in my presentation for the Raleigh Code Camp this coming weekend. While my presentation aims to dispel a number of these and show that unit testing can return a lot of value for low cost, I thought I would share the highlights from the “Why Not To Do It” list.

Read More...

Execution Plans – Indexing to achieve optimal query plans

(Given the size of this article, a download e-paper is also available [here][1]) The obstacle SQL Server and data storage itself is only as good as the means in which we can read the data. Very seldom are databases created only for the purpose of inserting and storing data without the intent of ever reading that data. While the type of structure or design of the data storage will vary depending on the type and majority of transactions that will occur on the database, the fact remains that the mechanisms in place must return the data quickly and without directly affecting other transactions from committing their own primary objectives.

Read More...

Using Binding Redirects to Stay Out of DLL Hell

We found ourselves in a tricky situation at work this week. I’m surprised it hadn’t come up before, but I suppose our customers aren’t always the type to move to a new technology quickly. But we had a customer trying to install the back end of our application on a Windows 2008 server, and having trouble. We use AzMan to get our application’s permissions to work with windows authentication, and there was a new version included with server 2008.

Read More...

Who shrunk the files? (DBCC SHRINKFILE Audit)

Default Trace With SQL Server 2005, 2008 and on, there are many ways for us to now track events like SHRINKFILE. Some of these are Event Notifications, XEvents and the well-known but often-forgotten, Default Trace. The Default Trace has been in SQL Server since 2005 and by default is set to enabled. The Default Trace essentially captures and logs most configurations and schema changes that occur on SQL Server. Since the default trace is enabled by default, the chances of this logging mechanism being on in your environment are good.

Read More...

Virtual Lab Tip: Notifications from Windows Event Log

There are a number of environments or situations where large-scale systems monitoring is either not cost effective or simply not available. Windows 7 and 2008 include a feature for sending notifications when specific events occur in the event log. Technical Area: Accidental Systems Administrator, Accidental Database Administrator Level of Difficulty: Additional Articles:Virtual Lab entry on the LTD Wiki Using the Built-In Email Windows Vista, 7, and 2008 have a built-in option that allows us to attach actions to events from the event log.

Read More...

Tokenizing filenames in SQL Server

Someone at my job needed to grab a filepath, take out the filename and then split all the pieces into their own columns which were separated by either a dot or an underscore. If you had the following table CREATE TABLE #test (id INT primary key, PATH VARCHAR(1000)) INSERT #test VALUES(1,'Y:dgfdgdgd_Databla_2010_10_14_Pre_Calc.BAK') INSERT #test VALUES(2,'Y:dgfdbla_2010_10_15_Pre_Calc.BAK') INSERT #test VALUES(4,'Y:dgfdgdgdgdgdgdgdSome_Databla_2010_16_Pre_Calc.BAK') INSERT #test VALUES(3,'Y:dgfdgdgdgdgdgdgdSome_Databla_2010_11_12_Pre_Calc.BAK') Then this was the required output. id PATH 1 2 3 4 5 6 7 8 9 1 bla_2010_10_14_Pre_Calc_BAK bla 2010 10 14 Pre Calc BAK NULL NULL 2 bla_2010_10_15_Pre_Calc_BAK bla 2010 10 15 Pre Calc BAK NULL NULL 3 bla_2010_11_12_Pre_Calc_BAK bla 2010 11 12 Pre Calc BAK NULL NULL 4 bla_2010_16_Pre_Calc_BAK bla 2010 16 Pre Calc BAK NULL NULL NULL I thought that this was an interesting exercise, the person who asked me about this wrote some procedures and user defined functions but it was too slow because he was using a lot of charindex and substring functions and storing results in intermediate variables, then continued parsing until the end of the string.

Read More...

PASS Summit is upon us

PASS, the largest annual SQL Server conference, is quickly approaching. This means you only have a very short time to convince your Boss to make it his good deed for the year to send you. If you are required to justify why your company should spend thousands of dollars for you to attend, check out the ROI page on the PASS website for help/tips. Use all your charms and give it your best shot.

Read More...

SQLCop behind a Proxy

Today my good friend Aaron Lowe (Blog | Twitter) let me know he was having problems getting SQLCop to run. The error would come up as soon as the executable would be run to do the initial install and run of the program. Proxy servers lock down internet traffic to the point explicit allowances must be set in order for programs like SQLCop to function. SQLCop uses an internet connection to ensure that all checks and updates that are added are maintained.

Read More...