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

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.