SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Trigger Based Change Data capture


Trigger Based Change Data capture

Author
Message
Ankush Parab
Ankush Parab
SSC Veteran
SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)

Group: General Forum Members
Points: 204 Visits: 177
Comments posted to this topic are about the item Trigger Based Change Data capture
qbrt
qbrt
SSC Eights!
SSC Eights! (952 reputation)SSC Eights! (952 reputation)SSC Eights! (952 reputation)SSC Eights! (952 reputation)SSC Eights! (952 reputation)SSC Eights! (952 reputation)SSC Eights! (952 reputation)SSC Eights! (952 reputation)

Group: General Forum Members
Points: 952 Visits: 700
This is good that you've shared this script. Thank you for that.
I think it would also be very helpful, if you can point out the shortcomings of synchronous data change tracking solution with triggers. Especially in a highly trans/sec OLTP environment. And also how BULK operations can be affected as well. At least link some articles that have already been written on this topic. This can help with the decision making process.
Dan Bragg
Dan Bragg
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 77
It would be good to be aware of what newer constructs you are using that will limit the backward-compatibility of your solution. CURRENT_TRANSACTION_ID only exists in SQL Server 2016, and IIRC, "CREATE OR ALTER" was added recently too (SQL Server 2013?). This drastically limits your target audience, unless you re-code your solution to be applicable to older versions. Some shops won't even see 2016 until well after 2020.
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (506K reputation)SSC Guru (506K reputation)SSC Guru (506K reputation)SSC Guru (506K reputation)SSC Guru (506K reputation)SSC Guru (506K reputation)SSC Guru (506K reputation)SSC Guru (506K reputation)

Group: General Forum Members
Points: 506935 Visits: 44273
I could be wrong (I won't load this code to test it) but this appears to record not only data that has changed, but also records data in all of the other columns that hasn't changed and it records meta-data about each column in the table as well as some constraint meta-data, and it looks like somewhere between 300 and 400 bytes (can't tell for sure because it's a graphic rather than text) were created for the JSON "Payload" for what? To audit that a single character was added to a single value during an update?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search