Author Archives: Clay Lenhart

About Clay Lenhart

I am a DBA/Technical Architect for Latitude Group and love technology.

Sorting uniqueidentifiers in SQL Server 2005

I had an issue recently where I needed to sort on a uniqueidentifier column and read the data in .Net. I found that .Net sorts Guids differently than SQL Server. You can see for yourself. Run the following code. DECLARE … Continue reading

Posted in SQL Server Development | 12 Comments

Are Foreign Keys Bad?

The Problem Mike Simpson’s post on foreign keys raises some good points: http://www.slipjig.org/Mike/post/2007/11/Are-Foreign-Keys-Bad–You-Decide!.aspx. The main issue raised is how foreign keys cause deadlocks. In order to avoid deadlocks, you have to acquire locks on records in the same order, always. … Continue reading

Posted in SQL Server Development | 19 Comments

Hello world!

I thought that blogs would be a fad, but it seems to have out lasted the fad stage   I use blogs everyday in my work looking for answers that other people have already seen and answered.  I hope with … Continue reading

Posted in Uncategorized | 5 Comments