Groups | Blog | Home
all groups > sql server programming > february 2007 >

sql server programming : How to monitor a particular table using profiler


prashant
2/2/2007 11:07:22 PM
I want observe what entries are getting into a table while I run an
application
OR any activities happening on a particular table
..How to monitor this
Adi
2/3/2007 1:08:59 AM
There are few ways to do it. The first way is to start up profiler
or set up server side trace and filter the textdata column with the
table's name. This way you'll see all activities on the table
including select statements.

Another way is to create stored procedure for insert, update and
delete statement. In the stored procedures you can insert a record
into log table with the details that you need. You can revoke insert,
update and delete statement on the table and let users work with the
stored procedure only. Notice that anyone that belongs to db_owner
role or sysadmin server role will still be able to work directly with
the table.

Another option is to create trigger on the table for update, insert
and delete. In the trigger you can log anything into a log table.
This way you will be able to log all data modification operations
regardless the way that it was done (direct SQL statement or through
stored procedure).

Adi


[quoted text, click to view]

Aneesh
2/3/2007 1:04:46 PM
You can use the Profiler to monitor this



[quoted text, click to view]

AddThis Social Bookmark Button