Arun
Arun

Reputation: 61

How to check if CHANGE_TRACKING is enabled for a Snowflake Table?

I am trying to validate if CHANGE_TRACKING is enabled for a Snowflake Table. Is this information available in Information_Schema?

Upvotes: 5

Views: 5953

Answers (1)

Gokhan Atil
Gokhan Atil

Reputation: 10059

As far as I know, it's not available in information_schema, but you can check change_tracking column of the SHOW TABLES command:

show tables like 'employees';

+-----------+----------------------+-----------------+---------------------+------------------------------+
|   name    | automatic_clustering | change_tracking | search_optimization | search_optimization_progress |
+-----------+----------------------+-----------------+---------------------+------------------------------+
| EMPLOYEES | OFF                  | ON              | OFF                 |                              |
+-----------+----------------------+-----------------+---------------------+------------------------------+

SHOW TABLES https://docs.snowflake.com/en/sql-reference/sql/show-tables.html

You may use result_Scan function to process the output of SHOW TABLES command.

RESULT_SCAN https://docs.snowflake.com/en/sql-reference/functions/result_scan.html

Upvotes: 9

Related Questions