• For example, above DVM will count rows inserted by uncommited transactions. SQL Server 2008.

    Open two queries in Managment Studio. In first query run

    CREATE TABLE [testDVM](

    [a] [int] NULL

    ) ON [PRIMARY]

    GO

    BEGIN TRAN;

    INSERT testDVM

    SELECT top(10) 1

    FROM sys.all_objects;

    Start the second query

    DECLARE @RowCount1 INT;

    SELECT @RowCount1=SUM(row_count)

    FROM sys.dm_db_partition_stats AS ddps

    WHERE ddps.index_id IN (0,1) AND ddps.object_id = OBJECT_ID('TestDVM');

    SELECT Count(*) - @RowCount1 AS delta

    FROM TestDVM;

    return to the first one and run

    INSERT testDVM

    SELECT top(20) 2

    FROM sys.all_objects;

    COMMIT TRAN;

    See the result of the second query. Apparently DVM was not waiting for the transaction to commit.