Home > Forum > Data sources > Stored Procedure as Datasource

Stored Procedure as Datasource
0

Hello.

Is there a way to use a stored procedure as datasource instead of a view or table or Select statement?

I use at the moment a query on two tables (UNION) which has an inner join on another table. The speed is not really breathtaking, thus I wanted to use a stored procedure where I can perform all the timetaking steps already on the SQL server.

Regards
Klaus

MVP

Hi Klaus,

maybe you can change your procedure to a table-valued function, than you could easily use it in an select statement.
An example using one of the provided table-valued functions in the BPS content db:
select item
from dbo.SplitToTable('a,b,c,d',',')

Otherwise you could test this approach, which I didn't test myself.
http://www.techbrothersit.com/2014/08/tsql-how-to-execute-stored-procedure-in.html

Best regards,
Daniel

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings