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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Humanoidhuman
Frequent Visitor

Connect Linked SQL Server to Power BI Desktop

Background and Problem:

I am trying to create a Power BI report using data pulled from MSSQL server to which I have access. I am able to successfully connect to the primary SQL server using the regular connection steps. However, the dbo which has the data I need for this particular report lives on a linked server which is connected to my primary MSSQL server (I can access it on MSSQL management studio under the path >>'Server Objects' > 'Linked Servers' > 'My Linked server').

 

Anticipated Solution:
I am hoping to establish a connection to the linked server so I can access the dbo which has the data that i need for my report. 

TIA!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

In your connection definition try running a SQL query against the linked server.

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

In your connection definition try running a SQL query against the linked server.

I tried running the a SQL script under advanced options while establishing connection to the server (picture below), but it asks for a database. For this I tried entering the linked server name as well but it doesn't establish connection saying authentication failed. I double checked my credentials and permissions all the server they seem to be all there. 

Humanoidhuman_0-1720533493986.png


I am also attaching the script I used below for reference

SELECT * FROM linkedserver.Runtime.dbo.History 
WHERE TagName = 'SysTimeSec' 
AND DateTime >= '2023-09-12 12:59:00' 
AND DateTime <= '2024-01-12 13:00:00'


Please let me know what I am doing wrong. TIA!

 

Use the initial server and database for the connection. The database is NOT optional, that dialog title is faulty.

Then run the query as you listed it.

Thank you for that. However, as you can see below, the linked servers do not fall under the any database. For this purpose I am unable to discern what to enter as a database when linking to the SQL server

Humanoidhuman_0-1720624525223.png

 

Pick any database on the original server that you have access to.

Thank you so very much. That worked!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.