# Get data from multiple databases in External BAQ

**URL:** <https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105>\
**Category:** Epicor ERP 10\
**Tags:** external-baq\
**Created:** [July 17, 2023, 9:04pm UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105 "2023-07-17T21:04:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Potato](https://www.epiusers.help/user_avatar/www.epiusers.help/potato/32/72202_2.png) [@Potato](https://www.epiusers.help/u/Potato)\
**Post date:** [July 17, 2023, 9:04pm UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/1 "2023-07-17T21:04:03Z")

</div>

I set up an external BAQ that can query an external database.

Is it possible to set up the external BAQ or connection settings so that it can query two databases on the same external server? Right now, my external BAQ can only see the one database specified as the “Initial Catalog” in the External Datasources app.

Thanks!

---

<div class="post-metadata">

**Author:** ![Potato](https://www.epiusers.help/user_avatar/www.epiusers.help/potato/32/72202_2.png) [@Potato](https://www.epiusers.help/u/Potato)\
**Post date:** [July 17, 2023, 9:41pm UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/2 "2023-07-17T21:41:43Z")

</div>

I found an easy workaround. I just needed to create views of the tables I need from the second external database inside of the first external database.

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [July 18, 2023, 12:39am UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/3 "2023-07-18T00:39:07Z")

</div>

You’re pretty smart for a spud.

---

<div class="post-metadata">

**Author:** ![GaryWarn](https://www.epiusers.help/letter_avatar_proxy/v4/letter/g/958977/32.png) [@GaryWarn](https://www.epiusers.help/u/GaryWarn)\
**Post date:** [July 18, 2023, 10:30am UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/4 "2023-07-18T10:30:58Z")

</div>

As an alternative to using a View you could use a Synonym [[Synonyms (Database Engine) - SQL Server | Microsoft Learn](https://learn.microsoft.com/en-us/sql/relational-databases/synonyms/synonyms-database-engine?view=sql-server-2017)] it’s just a matter of choice.

---

<div class="post-metadata">

**Author:** ![Olga](https://www.epiusers.help/letter_avatar_proxy/v4/letter/o/57b2e6/32.png) [@Olga](https://www.epiusers.help/u/Olga)\
**Post date:** [July 18, 2023, 3:52pm UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/5 "2023-07-18T15:52:56Z")

</div>

interesting, I never tried to use it in extBaq, does it work?

---

<div class="post-metadata">

**Author:** ![GaryWarn](https://www.epiusers.help/letter_avatar_proxy/v4/letter/g/958977/32.png) [@GaryWarn](https://www.epiusers.help/u/GaryWarn)\
**Post date:** [July 18, 2023, 4:16pm UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/6 "2023-07-18T16:16:50Z")

</div>

unfortunately Synonyms can’t be used directly in an extBaq but they could be used from within a view that the extBaq is referencing.

---

<div class="post-metadata">

**Author:** ![brettstutzman](https://www.epiusers.help/letter_avatar_proxy/v4/letter/b/eb9ed0/32.png) [@brettstutzman](https://www.epiusers.help/u/brettstutzman)\
**Post date:** [September 6, 2024, 5:35pm UTC](https://www.epiusers.help/t/get-data-from-multiple-databases-in-external-baq/105105/7 "2024-09-06T17:35:18Z")

</div>

What about the aspect of making a linked server in Server A to Server B. Then you can query external server A and reference linked server B such as linkedserverB.Dbasename.tablename in from clause of ext BAQ?  
 ![image](https://www.epiusers.help/uploads/default/original/3X/6/3/63e444896b66b0478e2f9554c84fa750a53b1678.png)
