Forum Discussion
Markzolotoy
5 years agoImpactful Individual
Error loading data
I have the following SQL in my query: declare @AlarmSummaryAlramCount table (summary_description nvarchar(20), summary_cnt int);
DECLARE @reportData TABLE(
reportID int, userSID varchar(max), ...
ToddChitt
5 years agoSuper User
Does this EXACT text work in SSMS?
Not sure you can do complex statements, stuff with declared variables, etc. Maybe you should wrap this into a stored procedure in the database then run that proc from Power BI.
Markzolotoy
5 years agoImpactful Individual
ToddChitt I have converted my code into SP and it's exactly same error. Smells to me like a PBI bug.
I am calling the store proc like this:
exec usp_GetAlerts_Summary_Counts 3, '.................'
Get this:
Microsoft SQL: Incorrect syntax near the keyword 'exec'. Incorrect syntax near ')'.