• Nice article. A minor nit-pick. You need to initialize the @col variable to an empty string befory running the MAV query. Otherwise, your result will be NULL.

    I've also used this for quick and dirty CSV list generation. For long lists, though, say over 500 elements, a FOR XML query, like Paul White's above, is much faster.