Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 61791

Has the ability to refresh a dataset with a dynamic SQL stored procedure been disabled?

$
0
0

Up until today, I had a dataset that was able to be refreshed perfectly fine through the Service.  This particular query has a single database as a source, which is an Azure Database.  The dataset uses 4 queries to get data from the database.  2 which are views, and 2 which use Stored Procedures that take in a few parameters.

 

In the case of the Stored Prodedure, the parameters require a filter string and a Start Date/End Date for the returned rows.  The dates change every day as its up until current.

 

Here is what my code calling one of the stored procedures looks like in Power Query:

 

Source = Sql.Database("<MyServerName>.database.windows.net", "<MyDataBase>", [Query="Exec Example.[sp_ExampleStoredProcedure] 0, " & fnStartDate & ", " & fnEndDate & ", 'EP231%'", HierarchicalNavigation=true, CommandTimeout=#duration(0, 0, 90, 0)]),

(i've changed some names for privacy reasons)

 

The functions that make the parameters dynamic are:

let
    Result = "'" & DateTime.ToText(Date.AddYears(DateTime.LocalNow(), -2), "yyyy") & "-01-01'"
in
    Result

and

let
    Result = "'" & DateTime.ToText(DateTime.LocalNow(), "yyyy-MM-dd") & "'"
in
    Result

 

When i check the service for this dataset, i no longer get the option to refresh the dataset, or even set "Connect directly".  When i look at the refresh history, you can see where it previously worked and then it starts to fail today.  If i remove the Stored Procedures from the dataset, i'm able to select "Connect Directly" again.  I only found this coincedently when i went to make minor updates this morning to a report.Capture.PNG

 

 

The error now stating:

Data source error:
Unable to refresh the model (id=1767871) because it references an unsupported data source.
Cluster URI: WABI-SOUTH-EAST-ASIA-redirect.analysis.windows.net
Activity ID: 725ea1be-d2db-4f55-ace8-9a91ccc4b307
Request ID: af57b3a0-5ce2-437a-aba8-2f8e6e08e1b8
Time: 2018-04-09 00:25:48Z

 


Viewing all articles
Browse latest Browse all 61791

Trending Articles