Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PijushRoy
Super User
Super User

Need to run SQL Statement which is join by Two Database (Import/Direct Query/Live)

Hi Teams,

Need to run SQL Statement which is join by Two Database. For Direct Query or Import, I need to specify the Server and Database name. Here issue is, in same SQL two database table are joined, so showing error when I am trying. 

 

Are there any process to overcome the issue?

 

Thanks Teams




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





1 ACCEPTED SOLUTION


@PijushRoy wrote:

@Shahfaisal 
When you paste SQL Code in SQL Windows box, that time database is compulsary
Please try.


Yes, you will be required to if you are putting the sql code. However, you can just specify one of the databases in there. As long as you use three-part naming (specify database name in the code) you should be fine. For example, I just used te following (to show you) on my database server without any issues.

Shahfaisal_0-1667145892710.png

 

 

View solution in original post

6 REPLIES 6
Shahfaisal
Solution Sage
Solution Sage

Specifying Database is optional. You can just ignore it and it should work. If you ae still having issues, please post the error. Make sure that your sql code is referencing the database name.

@Shahfaisal 
When you paste SQL Code in SQL Windows box, that time database is compulsary
Please try.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!






@PijushRoy wrote:

@Shahfaisal 
When you paste SQL Code in SQL Windows box, that time database is compulsary
Please try.


Yes, you will be required to if you are putting the sql code. However, you can just specify one of the databases in there. As long as you use three-part naming (specify database name in the code) you should be fine. For example, I just used te following (to show you) on my database server without any issues.

Shahfaisal_0-1667145892710.png

 

 

Hi @Shahfaisal 

Thanks for your post and small change SQL I am able to load the data but validation is pending.
My thinking is, if I post one database name top and join with other table in SQL box, it will not work. But now I am able to load the data.
I will update here after verify the data
Thanks for your reply.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





@Shahfaisal ?
Is the sql fetching/loading correct data? For me I am getting error. 
Please check and confirm




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!






@PijushRoy wrote:

@Shahfaisal ?
Is the sql fetching/loading correct data? For me I am getting error. 
Please check and confirm


It would get the correct data as long as your sql code is correct. As I mentioned before, please post you error message here.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.