DataSunrise Achieves Databricks Validated Partner Status. Learn more →

Capture Row Changes with Before/After Values

Capture Row Changes with Before/After Values

Most database audit tools log SQL statements but miss the actual data changes. With before and after values, you can capture row changes and see exactly what data looked like before and after an UPDATE or DELETE operation. If an UPDATE hits 500 rows, you still know exactly what changed.

DataSunrise 12.0 adds Before/After Values, a row change capture feature that records the actual row data involved in UPDATE and DELETE operations.

How Row Change Capture Works

DataSunrise injects database-native clauses into the SQL sent to the server. The database returns an extra result set with old and new row values, DataSunrise captures it for auditing, and then suppresses it before it reaches the client. The application never sees the difference, and the original SQL in the audit trail stays unchanged.

The specific mechanism depends on the database:

  • PostgreSQL 18+ (and compatible): RETURNING OLD.*, NEW.* for full row change capture
  • PostgreSQL < 18 (and compatible): RETURNING * gives after values for UPDATE and before values for DELETE
  • Microsoft SQL Server: OUTPUT DELETED.*, INSERTED.* for full row change capture
  • MariaDB 10.0.5+: RETURNING * for DELETE operations only

For UPDATE operations, you get both the old and new row values stored as separate datasets. For DELETE operations, you get the row values before deletion. The data appears in the Transactional Trails event detail view under dedicated tabs for previous and new values.

Supported Databases for Row Change Capture

Beyond PostgreSQL, SQL Server, and MariaDB, this feature works across PostgreSQL-compatible and SQL Server-compatible databases, including AlloyDB, CockroachDB, Greenplum, YugabyteDB, Azure SQL Database, Azure Synapse Analytics, and others. The full list is available in the Supported Databases and Features documentation.

Capture Row Changes Without Database Changes

The feature works entirely at the proxy level. No triggers, no CDC configuration, no schema changes, and no application code updates are required. You enable the Before/After Values checkbox in your Audit Rule settings and you are done. It is available in Proxy mode only, since it needs to modify the SQL sent to the database.

For configuration details, see the Data Audit and Transactional Trails sections of the User Guide.

Need Our Support Team Help?

Our experts will be glad to answer your questions.

General information:
[email protected]
Customer Service and Technical Support:
support.datasunrise.com
Partnership and Alliance Inquiries:
[email protected]