Profiler will capture all insert statements, sure, but what if it is a
single INSERT INTO table SELECT * FROM BigTable? Or a join? What about
SELECT INTO statements?
If you want to monitor rowcounts of key (or all) tables over time, I would
periodically stuff row count values from the DMVs into a table, then you can
easily see deltas over any time frame that your collection is running.
For example,
CREATE TABLE dbo.TableRowCountLog
(
TableName SYSNAME,
[RowCount] INT,
PollTime SMALLDATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
Then periodically:
INSERT dbo.TableRowCountLog(TableName, [RowCount])
SELECT OBJECT_NAME(object_id), MAX(row_count)
FROM sys.dm_db_partition_stats
-- WHERE OBJECT_NAME(object_id) IN ('list','of','key','table','names')
GROUP BY OBJECT_NAME(object_id);
> Anyone know how determine how many new records ( or insert statments)
> are occuring in a spefic SQL Server 2005 database. I have been
> working with the profiler and trace tool to try to find this
> information, but no luck so far. Thanks!