Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Detect Table Changes

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-12-17 : 08:14:27
Guy writes "I'm looking for a way to detect activity (insert/update/delete) on a SQL Server table from a program (written in vb6 if that matters). The best idea we've come up with so far is a trigger that writes a file on the network somewhere, and the application monitors that directory (via FindFirstChangeNotification probably). We don't care what the activity is, just that something happened. We can query the table to find out what happened. Right now that's what we're doing, querying the table from the program on a timer, but this seems rather crude. The method I mentioned above would work I think, but I thought there might be a more elegant solution out there.

Thanks in advance."

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-12-17 : 08:26:37
You could add login and date info into your tables which get set when an Insert/Update/Delete is carried out. You can then look for activity based on any time or date or person.

If your database is large though this may take a while to implement.

You could handle this very easily from the VB side of things as well.

===========
Paul
Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-12-17 : 08:28:19
instead of storing the records in a file. better option is you can store it in a table and view the changes by quering it.

if you dont want to take the pain of building a Audit system from the scratch. there are software's which will do this for u . a quick forum search will yield you good links to ponder on.

-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson
Go to Top of Page
   

- Advertisement -