• The TVP feature is an improvement, yes. BUT you wrote dozens and dozens of lines of code that were only precompiled. The better path was is at the end of your article, "Large datasets that are inserted directly (i.e. not transformed) will likely be faster via T-SQL BULK INSERT, bcp.exe..."

    Here's the universally easy way to transform data

    1) dump it to ASCII text on the main frame, DB2, universe, oracle, informix or mySQL; parse the attributes with a character like tab or comma or whatever; end the lines with CRLF to be fully compatible with Windows.

    2) FTP pull/push the file to a disk on the SQL Server

    3) BULK INSERT or BCP the text into a staging table or a memory table like TVP (watch out for your tempdb if memory table)

    4) Transform the data in the staging table or the memory table

    5) dump the result into the destination

    This is the only sensible way to get data over a busy network into a SQL Server database. The rest just run slower and are buggier.