Forum Discussion

danszczepanski's avatar
danszczepanski
New Contributor III
2 days ago

Reference External DB and Application DB in one SQL Query

Hello, I am writing a SQL Query that references tables in different databases, one that exists in the External database (BI Blend) and one that exists in the Application database. I am having troubl...
  • sameburn's avatar
    2 days ago

    Hi danszczepanski

    As Teresa and Daniel have pointed out. You can achieve this with a Dashboard DataSet BR.

    You would need to execute both sql commands separately e.g datatable1 is from application database and datatable2 is from framework database

    You can then use the DataTable Merge method (assuming both datatables have the same columns as per your union statement) to merge the two datatables.

    Then return the merged DataTable to your Data Adapter. 

    https://learn.microsoft.com/en-us/dotnet/api/system.data.datatable.merge?view=net-9.0&redirectedfrom=MSDN#overloads

    Hope this helps