I haven't written many UDF's, but I certainly didn't intend to simply use the SQL as it was written...I was simply musing on what I believe is the method's potential for good.
It was a POC...that's all...to illustrate to me that SQL contained some of the right things to solve this issue. It was never intended as a final solution, simply one method among a multitude of others.
I didn't expect a full on code review.
This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.