September 18, 2011 at 10:39 pm
September 19, 2011 at 10:18 am
Is there a question here, or is this just a demo of the most convoluted way possible to do table auditing?
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
September 19, 2011 at 10:26 am
toddasd (9/19/2011)
Is there a question here, or is this just a demo of the most convoluted way possible to do table auditing?
Convoluted to say the least. It also doesn't work for more than single row modifications. If you want some help making this trigger easy to understand, fast and functional please read the link in my signature about best practices for posting questions.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 19, 2011 at 11:38 am
Wow. That's a complex way of doing this.
Considering all the overhead built into this, all based on the assumption you don't know what table the trigger is being built on, I'm not at all surprised it would cause some blocking problems. Possibly even deadlock problems.
It also won't handle multi-row updates at all.
Take a look at these articles, see if they help:
http://www.sqlservercentral.com/articles/Auditing/63247/
http://www.sqlservercentral.com/articles/Auditing/63248/
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply