Snowflake's DML Error Logging feature (ERROR_LOGGING = TRUE) enables graceful degradation for INSERT, UPDATE, and MERGE operations. Instead of rolling back an entire batch when a single row fails, Snowflake inserts valid rows normally and routes failed rows to an auto-created error table with full metadata including error code, message, source column, and original row data. The post covers enabling/disabling the feature, querying the ERROR_TABLE() function, error recovery patterns, change tracking via streams on views, access control with GRANT SELECT ERROR TABLE, session-level opt-out, Snowpipe Streaming integration, performance considerations, and key limitations such as lack of support for COPY INTO and multi-table inserts.

9m read timeFrom medium.com
Post cover image
Table of contents
DML Error Logging in Snowflake: Never Lose Track of Failed Rows AgainThe Problem: All-or-Nothing DML FailuresGet Dipal Mahajan’s stories in your inboxWhat Is DML Error Logging?Getting StartedDisabling Error LoggingHow It Works: A Walkthrough## Error Table SchemaAdvanced PatternsError Recovery: Fix and Re-insertChange Tracking with StreamsHousekeeping: Truncate the Error TableAccess ControlSession-Level Opt-OutWorks With Snowpipe Streaming TooPerformance and Cost ConsiderationsKey Limitations to KnowQuick ReferenceConclusion

Sort: