• Creating a SQLCLR object to do this is going to be your best chance initially. Ideally though you would not have stuff like that running in your data tier, and you would host something like that on an application server.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato