Joe
Joe

Reputation: 626

SQL Server query with Superset not allowing to execute stored procedure

I am trying to execute the following stored procedure in Superset SQL Editor:

Exec [CI_DW1].[Reports].[spGetPSBMFuelBidOfferVolume]
  @fromDate = '20220824',
  @toDate = '20220824'

But when I press 'Run Selection', it returns the following error:

DB engine Error
Only SELECT statements are allowed against this database.

I can confirm that the user does have exec permission on the database, and successfully tested it by running as the user in SQL Server Management Studio.

My connection string is:

mssql+pyodbc://username:password@server:port/database?TrustServerCertificate=YES&driver=ODBC+Driver+18+for+SQL+Server&encrypt=yes

And I can use the connection to run select queries in superset successfully.

Has anyone else come across this before? Is it a limitation of superset or is there a way to solve this?

Upvotes: 0

Views: 1669

Answers (1)

Sandeep Kumar Narware
Sandeep Kumar Narware

Reputation: 250

It looks like superset does not allow you to call the stored proc, but there is a workaround you can use OpenQuery to get the result from a stored proc

enter image description here

Upvotes: 1

Related Questions