Blog posts page 9 of 44

SQL Server query plan cache – what is it and why should you care?

SQL Server like all databases goes through a number of steps when it receives a command. Besides parsing and validating the command text and parameters it looks at the database schema, statistics and indexes to come up with a plan to efficiently query or change your data.

You can view the plan SQL Server comes up with for a given query in SQL Management Studio by selecting Include Actual Execution Plan from the Query menu before running your query.

When an object-relational mapper is too much, DataReader too little

I fired up Visual Studio this evening to write a proof-of-concept app and found myself wanting strongly typed domain objects from a database but without the overhead of an object-relational mapper  (the application is read-only).

One solution is to write methods by hand, another is to code generate them but it would be nice to be able to do:

First impressions of Snow Leopard

I came home from work today to find my family pack upgrade version of Snow Leopard. It’s been a few hours, so here are impressions so far.

The packaging was very small and lightweight and eco-friendly compared to the big-plastic-box-monsters that come out of Redmond.

LINQ to SQL cheat sheet

A few short words to say I’ve put together a cheat sheet for LINQ to SQL with one page for C# and another for VB.NET.

It shows the syntax for a number of common query operations, manipulations and attributes and can be a very useful quick reference :)

Dictionary<T> look-up or create made simpler

The design of a Dictionary<T>Dictionary<T> lends itself well to a caching or identification mechanism and as a result you often see code that looks like this:

It’s not that it is particularly difficult but it can be a bit error prone and when you’re doing it over and over. What would be nicer is something that let you do:

LINQ to SQL resources

  • 📅
  • 📝 723
  • 🕙 4
  • 📦 .NET

A quick round-up of some useful LINQ to SQL related resources that are available for developers. I’ve not used everything on this list myself so don’t take this as personal endorsement.

Note: While the T4 templating language is built-in to Visual Studio 2008/2010 it does not come with syntax highlighting or IntelliSense. Check out either: