Run dbt between separate snowflake databases in the same account

I have a snowflake account with my raw data in database RAW, and a separate database ANALYTICS where I would like to store the output of transformation models done by dbt, e.g.

run model abc.sql “select 1 from RAW.schema.table” → should end in “ANALYTICS.dev.abc”

how do I set up my project to allows for a transformation between different databases?

I have tried granting dbt-user/role OWNERSHIP on both databases, but still run into “schema does not exist or not authorized.”

Hey @Vince, this is definitely best practice - you’re on the right track!

I’ve never set up Snowflake permissions myself, but we have an example in our docs: Snowflake Permissions | dbt Docs

If this doesn’t get you unstuck, can you share more about the specific dbt code you’re using which is resulting in that error?

1 Like

The Snowflake permissions script you linked what was I was missing, that worked!

Ran that over both databases for the TRANSFORMER role I created for the dbt-user, and no more permission conflicts.
Previously I had only granted OWNERSHIP to the TRANSFORMER role, which apparently did not suffice; seems like the individual (future) USAGE-grants on the databases from the script were what was necessary.

Thank you for your kind & helpful reply @joellabes
all the best to you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.