• One slip Jeff, and I am surprised both that you made it and that no one else mentioned it yet (in my quick review of the thread): you used an Nvarchar(10) to store the output. That introduces a CONVERT_IMPLICIT into the Compute Scalar operation that is unnecessary and which skews the CPU and duration of the runs.

    Second, I tried this, expecting the CONVERT_IMPLICIT to float removal to make the STR() run much more efficient. I was mistaken and quite surprised that it did not make it much faster!

    CREATE TABLE #t2 (a float)

    GO

    INSERT #t2

    SELECT CAST(somenumber AS float)

    FROM #MyHead

    DECLARE @Bitbucket VARCHAR(10)

    SELECT @Bitbucket = STR(a,10) FROM #t2

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service