• I just learned about MAX_ODSOLE_OBJECTS. I traced your code and it looks like you're destroying all your created objects, i.e. no leaks, but it is quite odd that you;re dying on the call to sp_OAMethod and not on an spOA_Create.

    Some relevant links:

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=82456

    http://mssql.meetholland.com/message/30123.aspx

    May I suggest that you convert this code to use SQLCLR?

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