# How to join multiple BigQuery tables from different GCP projects

**URL:** <https://discourse.getdbt.com/t/how-to-join-multiple-bigquery-tables-from-different-gcp-projects/5311>\
**Category:** Help\
**Tags:** best-practice\
**Created:** [November 9, 2022, 1:04pm UTC](https://discourse.getdbt.com/t/how-to-join-multiple-bigquery-tables-from-different-gcp-projects/5311 "2022-11-09T13:04:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbt101](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dbt101](https://discourse.getdbt.com/u/dbt101)\
**Post date:** [November 9, 2022, 1:04pm UTC](https://discourse.getdbt.com/t/how-to-join-multiple-bigquery-tables-from-different-gcp-projects/5311/1 "2022-11-09T13:04:33Z")

</div>

Hello,  
While writing dbt models, is it possible to JOIN multiple BigQuery tables from different GCP projects?  
Currenlty in profiles.yaml and dbt\_project.yaml we enter only one GCP project and dataset name.  
Please advise how to use multiple tables from different GCP projects in a dbt model?

---

<div class="post-metadata">

**Author:** ![minhajpasha](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/minhajpasha/32/1159_2.png) [@minhajpasha](https://discourse.getdbt.com/u/minhajpasha)\
**Post date:** [November 17, 2022, 5:09pm UTC](https://discourse.getdbt.com/t/how-to-join-multiple-bigquery-tables-from-different-gcp-projects/5311/2 "2022-11-17T17:09:59Z")

</div>

Hello @dbt101 ,

Please have a look profile.yml file to find the method.

Eg:  
my-profile:  
target: dev  
outputs:  
dev:  
type: bigquery  
**method: oauth**  
project: abc-123  
dataset: my\_dataset  
priority: interactive

if you are using OAUTH for running dbt locally, then your gcp profile/user-id should have access bq tables across the gcp projects.  
When you use a Service Account, this SA should have access to all bq tables across your GCP projects.

Regards.  
Minhaj

---

<div class="post-metadata">

**Author:** ![dbt101](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@dbt101](https://discourse.getdbt.com/u/dbt101)\
**Post date:** [November 17, 2022, 10:23pm UTC](https://discourse.getdbt.com/t/how-to-join-multiple-bigquery-tables-from-different-gcp-projects/5311/3 "2022-11-17T22:23:10Z")

</div>

Thanks Minaj, I tried oauth approach and it works.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [November 24, 2022, 10:23pm UTC](https://discourse.getdbt.com/t/how-to-join-multiple-bigquery-tables-from-different-gcp-projects/5311/4 "2022-11-24T22:23:49Z")

</div>

Closed on November 24, 2022, 10:23pm UTC

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