Sean Lange (3/19/2013)
Why not just look at the excellent code that Chris M posted earlier in one of the dozen or so threads on the same topic.http://www.sqlservercentral.com/Forums/Topic1432131-391-1.aspx#bm1432134
Why not, indeed. Thanks, Sean. You saved me a bit o' work here.
I read some of your replies on the thread that Sean posted a link to above. It would appear that you might want to learn the setbased way for this but you just don't understand it. Let me know if you want a short lesson on this so you can do such things on your own in the future.
--Jeff Moden
Change is inevitable... Change for the better is not.