• Nicely done! I hadn't seen @@procid before and I see, next to this one some great usages for it. So thanks a lot for the pointer.

    There is a potential caveat in 2 of your functions: since you're appending integers into the binary string, there can be any sort of "characters" in the string. i.e. you should not use len() on that binary string, instead you should use datalength(). For the rest, good trick to add to our "tool kits"!



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?