• Of course it is slow. For each row you open and close a certificate, insert just one row and overhead of calling procedure adds-up to that.

    Use table parameter to pass all data at once to procedure, open certificate just once and insert all in one big insert command, no loops are needed at all. You will be amazed.

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths