How would I call a Stored Procedure that returns data in a View? Is this even possible?
Sql-server – How to call Stored Procedure in a View
database-designsql-servertsql
Related Question
- Sql – Parameterize an SQL IN clause
- Sql – Insert results of a stored procedure into a temporary table
- Sql – Function vs. Stored Procedure in SQL Server
- Sql – How to do an UPDATE statement with JOIN in SQL Server
- Sql – How to SELECT FROM stored procedure
- Sql – How to UPDATE from a SELECT in SQL Server
- Sql-server – Get size of all tables in database
- Sql – Search text in stored procedure in SQL Server
Best Solution
This construction is not allowed in SQL Server. An inline table-valued function can perform as a parameterized view, but is still not allowed to call an SP like this.
Here's some examples of using an SP and an inline TVF interchangeably - you'll see that the TVF is more flexible (it's basically more like a view than a function), so where an inline TVF can be used, they can be more re-eusable: