- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

SQL Execution Timeout Expired
I have the following error when I try to import a large view using a SQL Query. While evaluating the query, it evaluates for 10 mins exactly and throws this error.
To provide further context, it reached a point where I was presented an option to load/transform data and I clicked on "Load" which is when it evaluated my query for 10 mins exactly and threw this error.
I've used a similar query in the past which worked flawlessly and still works. The only thing I added to the query are the two lines in bold in the code below.
Query 1: Here's the SQL Query I used which resulted in the error:
Query 2: Here's the SQL Query I used which worked flawlessly more than 10 times in the last few weeks:
Potential solutions I'm looking for:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

1. As far as the Power BI concerned, you only have the option of Increasing the timeout
2. If it is me, I will do query tuning.
2.1. Without knowing your details of the query,
looks like you are using View and then joining a table to filter i.e., v_InvoiceDetails and "Clinics".
Because you said the query without Clinics is taking more or less 10 minutes only. Typically, clinics data is kind of dim and less than view invoice details.
My guess is the view may have clinics already. If this is true, then you take a different approach
like
(Select * from view ... where view filters) left join the Clinics ... where
2.2. My second suspect is that You are doing date filter on two conditions for the same column
The SQL sounds as you are looking only for the last 3 years data and within them,
rows starting on or after Clinics First Date
To check if this is causing the issue, just hide the condition and load
i.e., include as join to Clinics table but remove this " AND VID.[Date] >= CL.FirstDate"
Try the join as inner join first and then as left join next
If there is no issues causing in joining the table
Then I suspect "Date" filtering is the issue. Can this be simplified? Yes, please rework on the query like above or different way.
3. Last is the indexes
hope this help ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

1. As far as the Power BI concerned, you only have the option of Increasing the timeout
2. If it is me, I will do query tuning.
2.1. Without knowing your details of the query,
looks like you are using View and then joining a table to filter i.e., v_InvoiceDetails and "Clinics".
Because you said the query without Clinics is taking more or less 10 minutes only. Typically, clinics data is kind of dim and less than view invoice details.
My guess is the view may have clinics already. If this is true, then you take a different approach
like
(Select * from view ... where view filters) left join the Clinics ... where
2.2. My second suspect is that You are doing date filter on two conditions for the same column
The SQL sounds as you are looking only for the last 3 years data and within them,
rows starting on or after Clinics First Date
To check if this is causing the issue, just hide the condition and load
i.e., include as join to Clinics table but remove this " AND VID.[Date] >= CL.FirstDate"
Try the join as inner join first and then as left join next
If there is no issues causing in joining the table
Then I suspect "Date" filtering is the issue. Can this be simplified? Yes, please rework on the query like above or different way.
3. Last is the indexes
hope this help ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hey @Anonymous ,
as we don't know your database it's hard to tell you how to improve the query. In general it's just a few joins, this is not that bad, but it depends much on the database and data.
The easiest appraoch might be to increase the timeout value. This you can easily do in the advanced settings for SQL Server data source:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Did you try increasing the time-out setting under "Advanced options"?

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
Anonymous
| 07-14-2022 03:28 AM | ||
10-06-2020 06:15 AM | |||
Anonymous
| 10-29-2019 06:59 AM | ||
03-13-2024 05:33 PM | |||
12-26-2022 06:33 AM |
User | Count |
---|---|
102 | |
84 | |
81 | |
53 | |
46 |