If only I were

Building Great Software

Archive for September 2007


leave a comment »

Two days I needed to take a block of records and turn the rows into a horizontal comma separated list. That comma separated list in turn needed to be the value for a column in a larger query.

I googled and found quite a few potential solutions and finally settled on using the COALESCE function. You certainly could use temp tables or cursors accomplish this. But the COALESCE function, with help from Arian and a bit of my tweaking ended up being a very succinct and easy to read solution.

SELECT @list = COALESCE(@list+’, ‘,”)+[FirstName] +’ ‘+[LastName]
FROM [UserTable]
SELECT @list

Of course there were some joins I needed to do in the FROM clause to get the correct data and it was also parameterized, but this was the gist of it.

I pushed the above snippet into a function, changed the last SELECT statement to a RETURN statement(for the sake of the function) and then used that function in the larger query to show the list of people as a comma separated list. It worked just as intended and solved the issue at hand.


Written by Chris Sutton

September 25, 2007 at 7:44 am

Posted in Technology

Tagged with

Bite me

leave a comment »

My son was showing us a mosquito bite on his knee this evening and right after that I asked if he was ready to go to bed.  He was still thinking about the mosquito and said “bite me” quite loud.

So the conversation flowed like this:

Dad: “Are you ready to go night night?”

2 year old: “Bite me”

Written by Chris Sutton

September 15, 2007 at 7:33 pm

Posted in Life

Conyne Kite

with one comment

Two weeks ago my brother-in-law and I found a new kind of kite called the Conyne and built it from scratch with dowel rods, thread, white glue, electrical tape and tissue paper.

We build it from about 8:00pm – 12:00 am and test flew it up and down main street from about 12:00 am – 1:00 am. But we couldn’t get enough wind while he was here to really put it up.

So yesterday finally there was enough wind to put it up and boy did it fly. It pulled so hard the cord cut into my hands pretty good. Its amazing how much stress tissue paper can withstand.


Written by Chris Sutton

September 14, 2007 at 9:12 pm

Posted in Life

Tagged with ,

Chipotle in Iowa City

leave a comment »

Finally Chipotle opened its doors today in downtown Iowa City. I’ve been missing their carnitas fajita burrito since moving from Colorado Springs.  I tried to find a good substitute, but Pancheros never really cut it for me.

Anyway we went downtown tonight and waited in a good sized line (almost ran outside the door) but it was well worth it.  The carnitas was salty with a light lemon flavor.  There is no carnitas like it in this part of Iowa.

If you live in the area, Chipotle is downtown at the Old Capitol Mall almost right across from Pancheros.

Written by Chris Sutton

September 14, 2007 at 8:33 pm

Posted in Iowa

Tagged with , ,

5 years

leave a comment »

March and I have been married 5 happy years today. And baby no. 2 is due in about 10 days as well.

I love you babe.

Written by Chris Sutton

September 14, 2007 at 8:06 pm

Posted in Life

CRIneta and Bryan Sampica

leave a comment »

We had the pleasure of having Bryan Sampica speak at CRIneta yesterday.  Bryan is a recent MVP and is one of three MVP’s in the state of Iowa(Javier and Nick are the other two that I know of).

He gave a lively talk on writing asynchronous callbacks with JavaScript and web services. Bryan used Microsoft’s Asp.Net Ajax libraries which was interesting since I’ve started seriously using ASP.Net Ajax on a project and could follow along well.

Written by Chris Sutton

September 11, 2007 at 9:43 pm

Posted in Iowa, Tech Community

Tagged with , ,


leave a comment »

It’s mid September and we have the first real feel of Fall in the air.  The temperature really dropped this week and we’ll likely have a good frost in the next couple of days.

This is good for two main reasons. Iowa is incredibly pleasant with these cooler temperatures and the frost means the ragweed loses its ability to make me miserable.

Written by Chris Sutton

September 11, 2007 at 9:21 pm

Posted in Iowa, Life, Thoughts

Tagged with ,

Virtual Earth V5

leave a comment »

About 4 years ago I did a lot of work with MapPoint on a commercial real estate site.  Once I was off that project I did very little mapping tools.  But I really enjoyed that project and working with mapping tools in particular.

So the other day I decided to spruce up a simple map on a client’s site, so I went straight to Google Maps.  I started to lookup the JavaScript that I needed to embed a map and add a couple of pushpins.  Then I went to register my base URL to do some testing and when I entered http://localhost:12345/Web the Google site kept crashing. 

So in my impatience I clicked over to the Virtual Earth MSDN site and realized that Virtual Earth is far easier to work with than MapPoint was three years ago(they have different uses so it’s not really fair to compare them).  With about 15-20 lines of JavaScript, Html and CSS I have a simple, clean map with a couple of pushpins showing on the map.  It couldn’t have been simpler and with such rich documentation and examples, it’ll be a breeze to finish that map.

Here are a couple of links to get you started:




Written by Chris Sutton

September 11, 2007 at 8:51 pm

Posted in Uncategorized

Tagged with , ,