• Is the slow down because of the INSERT itself?

    If not, I'd say check the execution plan. If it's the same as the one you get when you run the function on its own... I'm not sure what's up. You'd need to look at locking or wait stats or something. But I'll bet the exec plans are different.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning