How do you add a stream to a table in snowflake?

5.69K views
0

How do you add a stream to a table in snowflake?

Gisele Casillas Answered question November 8, 2021
0

You would use the command CREATE STREAM (or REPLACE STREAM) and it would create a new stream in the current schema or it would replace an existing stream. An example would be: create stream mystream on table mytable;

The command also supports:
-CREATE STREAM…CLONE (to create a clone of the existing stream)

However, if change tracking hasn’t been enabled then only the table owner can make the first stream on the table. Adding more streams would require a role that has been granted these privileges:
-Database: USAGE
-Schema: CREATE STREAM, USAGE
-Source table: SELECT

Gisele Casillas Answered question November 8, 2021