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.
Author |
Topic |
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-08-31 : 09:32:10
|
Guys,We looking to audit tables in the database. In the tables auditing needs to be done only on few columns not all the columns. Is there any 3rd party tool available to do it can it auditing be done on columns only with sql server 2005. Trigger doesnt work in this scenario as it works per row it does not say which column in the row was updated/inserted/deleted.For example in the below employee table, I want to audit(history) only ssn and dob columns - all the updates/inserts/deletes made to this column should be audited.empid empname ssn dob1 John,smith 122222222 07/29/2001Any suggestions and inputs would helpThanks |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-08-31 : 10:07:44
|
of course a trigger works here.you have update() nad columns_updated() functionsyou can also just audit the data from those columns by simply doing:select your desired columns herefrom inserted -- or deletedso what kind of a problem do you have?_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-09-01 : 05:14:39
|
"which column in the row was updated/inserted/deleted"I think the approach of auditing that a particularly column changes from "old" to "new" on a given record is a completely and utterly useless way to make an audit.There, I've said it!But I do feel very strongly about it.To read more of the debate have a look here:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=audit%20changesKristen |
|
|
|
|
|