you should run stored procedure, and export to csv file.
Stored Procedure:
ALTER PROCEDURE [dbo].[sp1] ( @p1 VARCHAR(50), @p2 INT )
You can take database command and select “Run Stored Procedure” In procedure name you can pass parameter as variable like this
sp1('$a1$','$a2$')
a1 and a2 are variables added in variable manager. (right side menu of client editor widget)
If param1 value is integer you can pass it like sp1($param1$,'$param2$').
For string parameter you need to put single quote.
($a1$ is variable, 2 is fix integer value: p1 will get value of a1, p2 will get 2)