Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

SQL Server Profiler or Trace Number of New Records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
juustagirl@yahoo.com - 20 Mar 2008 18:21 GMT
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!
Aaron Bertrand [SQL Server MVP] - 20 Mar 2008 18:30 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.