Treat existing tables and new tables separately
Ana can read ORDERS, but the new ORDERS_DAILY table is missing from her report. A grant on ORDERS covers only that object. An administrator can grant access to selected existing objects and use a future grant to set the initial permissions of newly created objects of a specific type.
ON ALL TABLES IN SCHEMA applies to current tables. ON FUTURE TABLES IN SCHEMA applies when a new table is created. A future grant can be appropriate in a schema where every new report table has the same audience. Review the scope carefully when a schema also contains sensitive or temporary data. Future grants can be inspected before approving them.
If database-level and schema-level future grants both target tables, the schema-level set takes precedence for new tables in that schema, even when the grantees differ. Revoking a future grant stops that rule for subsequent objects. Privileges already granted on tables still need separate review and revocation.
| Action within a reviewed reporting schema | Existing tables | Later tables |
|---|---|---|
| GRANT SELECT ON TABLE ORDERS | ORDERS only | No effect |
| GRANT SELECT ON ALL TABLES IN SCHEMA | Current tables | No effect |
| GRANT SELECT ON FUTURE TABLES IN SCHEMA | No retroactive effect | Initial grants at creation |
Plan ownership transfer as a separate change
OWNERSHIP is the privilege that gives one role control of an object. An owner can generally alter or drop the object. In regular schemas an owner can also manage its object grants. Managed access centralizes grant decisions in the schema owner or a role with MANAGE GRANTS.
GRANT OWNERSHIP transfers control to another role. When outbound privileges exist, choose deliberately whether to preserve them with COPY CURRENT GRANTS or remove them with REVOKE CURRENT GRANTS. COPY has additional grant authority requirements. Review the grants before and after any transfer. Keep the new owner inside the correct hierarchy and follow object-specific and managed-schema restrictions.
A REVOKE removes a particular grant path. Access can remain through another role, an inherited role or PUBLIC. Retest with the affected user and verify which path supplied the privilege.
Watch a grant rule before and after table creation
Use a disposable account, a lab operator with SYSADMIN and SECURITYADMIN, and an approved M17_LAB_WH. Substitute your operator and warehouse. Use fresh M17D_GRANTS, M17D_GRANT_READER and M17D_GRANT_OWNER names. The sample has one order per table, which makes each read easy to check.
Create two tables on opposite sides of a future grant
SYSADMIN creates BEFORE_RULE with order 101. SECURITYADMIN creates the reader and owner roles and records the future SELECT rule for tables in REPORTING. SYSADMIN creates AFTER_RULE with order 102. As the reader, expect 102 from AFTER_RULE and denial on BEFORE_RULE. Run the denial separately.
USE ROLE SYSADMIN;
USE WAREHOUSE M17_LAB_WH;
CREATE DATABASE M17D_GRANTS;
CREATE SCHEMA M17D_GRANTS.REPORTING;
CREATE TABLE M17D_GRANTS.REPORTING.BEFORE_RULE AS SELECT 101 AS order_id;
USE ROLE SECURITYADMIN;
CREATE ROLE M17D_GRANT_READER;
CREATE ROLE M17D_GRANT_OWNER;
GRANT ROLE M17D_GRANT_READER TO USER <TEST_OPERATOR>;
GRANT ROLE M17D_GRANT_OWNER TO ROLE SYSADMIN;
GRANT USAGE ON WAREHOUSE M17_LAB_WH TO ROLE M17D_GRANT_READER;
GRANT USAGE ON DATABASE M17D_GRANTS TO ROLE M17D_GRANT_READER;
GRANT USAGE ON SCHEMA M17D_GRANTS.REPORTING TO ROLE M17D_GRANT_READER;
GRANT SELECT ON FUTURE TABLES IN SCHEMA M17D_GRANTS.REPORTING TO ROLE M17D_GRANT_READER;
SHOW FUTURE GRANTS IN SCHEMA M17D_GRANTS.REPORTING;
USE ROLE SYSADMIN;
USE WAREHOUSE M17_LAB_WH;
CREATE TABLE M17D_GRANTS.REPORTING.AFTER_RULE AS SELECT 102 AS order_id;
USE ROLE M17D_GRANT_READER;
USE SECONDARY ROLES NONE;
USE WAREHOUSE M17_LAB_WH;
SELECT order_id FROM M17D_GRANTS.REPORTING.AFTER_RULE;
-- Expected denial. Run alone.
SELECT order_id FROM M17D_GRANTS.REPORTING.BEFORE_RULE;Change ownership and retire the future rule
SECURITYADMIN has MANAGE GRANTS and can transfer the regular-schema table with COPY CURRENT GRANTS. Verify that M17D_GRANT_OWNER receives OWNERSHIP and the reader’s SELECT survives. REVOKE CURRENT GRANTS would remove outbound grants during transfer. Assess readers and downstream jobs before choosing either option.
Grant SELECT on BEFORE_RULE explicitly. Revoke the future rule and create AFTER_REVOKE with order 103. The reader should still see orders 101 and 102. The new object should deny access. To remove access from the older table as well, revoke its separate SELECT and repeat its read.
USE ROLE SECURITYADMIN;
GRANT SELECT ON TABLE M17D_GRANTS.REPORTING.BEFORE_RULE TO ROLE M17D_GRANT_READER;
GRANT OWNERSHIP ON TABLE M17D_GRANTS.REPORTING.AFTER_RULE
TO ROLE M17D_GRANT_OWNER COPY CURRENT GRANTS;
SHOW GRANTS ON TABLE M17D_GRANTS.REPORTING.AFTER_RULE;
REVOKE SELECT ON FUTURE TABLES IN SCHEMA M17D_GRANTS.REPORTING FROM ROLE M17D_GRANT_READER;
SHOW FUTURE GRANTS IN SCHEMA M17D_GRANTS.REPORTING;
USE ROLE SYSADMIN;
USE WAREHOUSE M17_LAB_WH;
CREATE TABLE M17D_GRANTS.REPORTING.AFTER_REVOKE AS SELECT 103 AS order_id;
USE ROLE M17D_GRANT_READER;
USE WAREHOUSE M17_LAB_WH;
SELECT order_id FROM M17D_GRANTS.REPORTING.BEFORE_RULE;
SELECT order_id FROM M17D_GRANTS.REPORTING.AFTER_RULE;
-- Expected denial. Run alone.
SELECT order_id FROM M17D_GRANTS.REPORTING.AFTER_REVOKE;
USE ROLE SECURITYADMIN;
REVOKE SELECT ON TABLE M17D_GRANTS.REPORTING.AFTER_RULE FROM ROLE M17D_GRANT_READER;
SHOW GRANTS ON TABLE M17D_GRANTS.REPORTING.AFTER_RULE;
USE ROLE M17D_GRANT_READER;
-- Expected denial. Run alone.
SELECT order_id FROM M17D_GRANTS.REPORTING.AFTER_RULE;Remove the disposable objects
SYSADMIN owns the database. SECURITYADMIN owns the custom roles. Review grants before cleanup and check that neither role is used outside the lab. Expect the database and two roles to disappear. Keep the supplied warehouse.
USE ROLE SYSADMIN;
DROP DATABASE M17D_GRANTS;
SHOW DATABASES LIKE 'M17D_GRANTS';
USE ROLE SECURITYADMIN;
REVOKE ROLE M17D_GRANT_READER FROM USER <TEST_OPERATOR>;
DROP ROLE M17D_GRANT_READER;
DROP ROLE M17D_GRANT_OWNER;Diagnose an unexpected grant after deployment
If the release renames or swaps a table, inspect the grants on the actual target. Future grants do not apply upon rename or swap. A schema rule for the same object type overrides the database rule even when the recipients differ. SHOW FUTURE GRANTS tells you the rules. SHOW GRANTS ON TABLE tells you what attached to this object.
When an access removal appears ineffective, inspect the same user and session again. Role membership, PUBLIC, another grantor, or a different view can preserve access. Keep the denied test narrow enough to identify the remaining path.
Explain the design in an interview
Name the rule, then explain how you would prove it.
Do future grants cover tables that already exist?
I use an explicit grant for a current table and a future rule for objects created later. I test a known older and newer object.
What happens to readers during an ownership change?
I inspect outbound grants first. I would use COPY CURRENT GRANTS if approved access must survive and verify the new owner and reader permissions in SHOW.
Words used in this lesson
- Future grant
- A rule for initial privileges on objects created later.
- OWNERSHIP
- The privilege that makes a role responsible for controlling an object.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Snowflake GRANT, REVOKE, Future Grants and Ownership
Choose when the permission applies
The table grant affects an existing object. The future rule is evaluated for new objects.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Choose when the permission applies
The table grant affects an existing object. The future rule is evaluated for new objects.
ORDERS today → Future TABLE rule → Next table
- Check a removal separately
Stop the rule and inspect any existing privileges it previously created.
Future rule removed → Existing grants inspected → Affected role retested
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Compare what is granted with what would be granted later
SHOW GRANTS ON TABLE M17D_GRANTS.REPORTING.AFTER_RULE;
SHOW FUTURE GRANTS IN SCHEMA M17D_GRANTS.REPORTING;What to expect and why
As the authorized grant reviewer, compare these two outputs immediately after creating AFTER_RULE and again after removing the future rule. SELECT stays on the table after only the rule is revoked. The future grant row disappears.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
A database-level future SELECT goes to Finance and a schema-level future SELECT on tables goes to Reporting. Which rule applies when a table is created in that schema?
Compare your reasoning
Only the schema-level future rule applies to TABLE grants there. Check any separate current grants before predicting effective access.
Official sources and curriculum
Module 17 · See module scope
By Rohit Ray · Independent educational lesson · Explore this visual lab