I am interested in dumping data out of a database real-time. I know triggers are one way of doing this, but I was interested in another. I know of the stored procedures that SQL Profiler uses to monitor SQL Server. What I would like to know, is how do I monitor a single table and capture all events effecting this table via a C# program? How does SQL Profiler capture all the events real-time? "How do you expect to beat me when I am forever?"
You can use the SQL Server trace procedures for that and set a filter for object id as the table object id. Seehttp://sql-server-performance.com/forum/topic.asp?TOPIC_ID=1401 for ample links on the same. Gaurav Moderator Man thrives, oddly enough, only in the presence of a challenging environment- L. Ron Hubbard
You can configure all the settings Using SQL Profiler as if you are going to run it manually and then script this using File/Script Trace option. This will create a script file that you can possibly embedd into your C# program.
Also refer to this thread http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=1422. _________ Satya SKJ Moderator SQL-Server-Performance.Com