snowflake-cloud-data-platformdata-ingestion

Query Last Inserted or Last updated rows from Snowflake Table


I would like to know how can I query for rows which were created or updated on a given date without using any specific column to look up in the database table. Is there a way information_schema can provide us with row level insert/update datetime?


Solution

  • Row level modification timestamp is not available in the information_schema views currently.

    However, there is a column LAST_ALTERED in the SNOWFLAKE.ACCOUNT_USAGE.TABLES view that gives the Date and time when the table was last altered by a DDL or DML operation.

    https://docs.snowflake.com/en/sql-reference/account-usage/tables.html#columns