Forum Discussion
Native Database Query Error
SQL Server is the source. It ran successfully for multiple days but now the error is occuring.
Hi mw123,
Let me know if you receive this error in Power BI Service/Desktop/both?
Can you give a screenshot of your SQL query? Or provide a list of SQL commands you use (SELECT, CAST, EXEC etc.)
- mw1238 years agoFrequent Visitor
It is occurring in Power BI Desktop. I am trying to refresh a stored procedure that is being executed in PowerBI. It runs fine in SQL Server.
The procedure looks something like this:
declare @d date
set @d=(select max(added) from table1)set @d=dateadd(day,7,@d)
if getdate()>=@d
begin
drop table table1
select
field1,
@d as added,
field3,
field4
into
table1
from
table2
where substring(field2,1,1)='4'
update a
set a.field=date_convert(b.field)
from table1 as a,
table3 as b where
a.field1=b.field1- zoloturu8 years ago
Memorable Member
You need to add SELECT step there because it should return dataset. I see only SELECT INTO and UPDATE and some other steps but nothing about SELECT FROM.
- mw1238 years agoFrequent Visitor
I don't actual want a set of data returned, I am just updating that table. The problem is the update fails with that error being returned.