I'm trying to create an update trigger on a particular table that will fire BEFORE the update takes place. I'd like the trigger to select the values of the record that are about to be updated and insert them into another table first and THEN fire the update statement.
So, prior to updating table1-recordx, I want to insert the values of recordx into table2.
We will be using this technique as a way of auditing changes to a particular table with the ability to easily roll those changes back via a web-app front end screen.
Anyone know of a simple way to do this in SQL Server? Version is 2008 R2 if that matters.
With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.
Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server.
In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.