Blog Archives

Speeding up data access by using Linq to SQL or EF

Recall that LINQ based object relational mappers (ORM) use expression trees to effectively translate your C# (or other language) LINQ code into SQL. Many DBA’s and developers that don’t fully understand this technology are often quick to discredit it. I’m

LINQ to SQL & Entity Framework Pitfalls

In my last post describing the differences between LINQ to objects and LINQ to SQL, I mentioned how LINQ to SQL and Entity Framework “interpret” your LINQ code, and create the corresponding SQL. Forgetting this fact is extremely dangerous, because

Stored procedure reporting & scalability

Today’s post is a case study of sorts, about my former employer, who had an interesting architecture. It’s roots were VB6 and SQL server (version 6 I believe). They decided to put as much logic in their stored procedures as

SQL Server NULL values and “Order By” order

I have a few tables that contain a column called "Order", which is used to sort by when retrieving the data. The purpose is to keep the data in a certain order when displayed to the end user. Black Linen

When should you use database constraints?

A discussion came up at work recently about the extent of constraint usage in your databases. There were basically 2 camps: Constrain everything humanly possible. If it’s an integer that wouldn’t normally be negative, add a ">= 0" constraint. Constrain

LINQ, I’m not ready for you just yet

Today I was between features on the current project I’m working on, so I had some free time start researching some technologies I’ve been meaning to learn and start using. The topics at the top of my learning list are

Disable constraints in “After Insert” trigger

I have a table that stores extra information (Users) that gets associated with the "aspnet_Membership" table in my application. Since my table references the membership table, I have a foreign key for referential integrity. I added a trigger to the