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)
 Triggers

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-18 : 08:02:29
Simon Whatley writes "I am using triggers to log/audit changes to data for a given table. I want to cursor through the information_schema.columns for the table and then cursor through the rows for an updated column. I have been able to achieve the latter, but I cannot get the column cursor to work as IF UPDATE(@Column_Name) is not valid. Is this possible to achieve?

I am using SQL2k SP4 SE on Win2k SP4 Server."

surendrakalekar
Posting Yak Master

120 Posts

Posted - 2005-11-18 : 08:08:41
Insted of using cursor for table auditing use COLUMNS_UPDATED() function in trigger.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_create2_7eeq.asp

Surendra
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-11-18 : 11:23:40
I strongly recommend you don't do it column by column.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Triggers+to+audit+changes

Kristen
Go to Top of Page
   

- Advertisement -