     Author: Konstantin Taranov
     Modified date: 2017-12-23
     Version: 2.0
+
+    Author: Konstantin Taranov
+    Modified date: 2017-12-25
+    Version: 2.1
 */
 AS
 BEGIN TRY

      , DurationAccuracy VARCHAR(10)
        );

    PRINT('Benchmark started at ' + CONVERT(VARCHAR(27), CAST(CURRENT_TIMESTAMP AS DATETIME2(7)), 121));

    WHILE @r < @numberOfExecution
    BEGIN

                 , ClearCache
                 , PrintStepInfo
                 , DurationAccuracy
                 , ORIGINAL_LOGIN() AS OriginalLogin
             FROM @t;
        END
        ELSE
            INSERT INTO dbo.BenchmarkTSQL
            SELECT @TSQLStatementCHECKSUM AS TSQLStatementCHECKSUM
                 , StartTimeStamp
                 , RunTimeStamp
                 , FinishTimeStamp
                 , Duration
                 , TsqlStatement
                 , ClearCache
                 , PrintStepInfo
                 , DurationAccuracy
                 , ORIGINAL_LOGIN()
             FROM @t;

    SET NOCOUNT ON;
END TRY
