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 Administration (2000)
 trigger problem

Author  Topic 

rubs_65
Posting Yak Master

144 Posts

Posted - 2004-12-27 : 16:10:51
Hi,

We need to do auditing on few of our tables and want to capture the following information using trigger on tables:
1) when was the table modified
2) How is table modified - from Query Analyzer(QA) or Application
3) If from QA - directly modified table or ran procedure

I was able to get first 2 information using getdate() and master..sysprocesses in the trigger.
How to get the 3rd information. Is any system table store this information whether the sql is run against the table directly or sql executes the procedure that modifies the table?

Thanks
--Harvinder

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-12-27 : 16:18:27
You could use DBCC INPUTBUFFER using the spid number of the person making the change.

Tara
Go to Top of Page
   

- Advertisement -