Thanks again Michael.
This operation should be done in a table of a client's package, where I don't have much room (or experience) to add or modify things, like adding store procedures to it. I know it sounds strange, but some DBAs are very conservative to let third party people (like me) mess with standard package stuff they are using.
In the other hand they will still decide if they'll keep this app running on SQL Server or shift it to Oracle (that their ERP package uses), and I would like to have a solution that could work with both servers, by not using specific features of any of them.
Regards,
Fernando