Applies to
ApexSQL Trigger
Summary
This article explains how to place ApexSQL Trigger auditing tables in a different database from the one being audited
Description
For this example, the database being audited is called “ApexSQLTriggerAuditedDB”
The database where we want to store the audit information is called “ApexSQLTriggerStorageDB”
-
Start ApexSQL Trigger and create a new project. Connect to the “ApexSQLTriggerStorageDB”
- From the Advanced tab, in the Architecture section, click the Install option. In the Install the Auditing architecture dialog check the following:
- Internal DDL
- Reports (Standard and/or Aggregate and/or DDL)
-
Deleting the architecture
- Click Run, and then Yes when asked if you want to run the installation script
- Save the project
- Create another project (or open the existing one). Connect to “ApexSQLTriggerAuditedDB”
- From the Advanced tab, in the Architecture section, click the Install option.
In the Install the auditing architecture dialog check the following: - DDL
-
Deleting the architecture
- Again, click Run and then Yes when asked if you want to run the installation script
-
On the Home tab in the Triggers group, click the Edit template option:
-
In the template editor press Ctrl+F and in the search dialog search for
DatabaseName = “[” & “ApexSQLTriggerStorageDB” & “]”
-
Change the DatabaseName variable to
DatabaseName = “[” & “ApexSQLTriggerStorageDB” & “]”
- Save the project
- Make sure that users have updated rights to ApexSQLTriggerStorageDB
When triggers are fired, the rights of the owners of the tables where the triggers are will be used - Recreate the triggers
- To view audit reports, connect to the ApexSQLTriggerStorageDB
About ApexSQL Trigger
ApexSQL Trigger is a database auditing tool for SQL Server which allows you to monitor when and how the data was changed and who made the change. Audit SQL Server 2005 – 2014 databases