Add support for stored procedure result set output
Moved to tSQLt.org (Database Unit Testing for Microsoft SQL Server)
Brought to you by:
dennis_lloyd_jr,
maibotian
It would be really good to be able to test the output of a stored procedure.
Create Procedure Example.ProcedureOutput
As
SELECT 'JustName' as [Name]
Go
Then it would be good to be able to spy on the output without having to declare all the columns like this:
Create Table #actual (Name varchar(255) null);
Insert #actual
Exec Example.ProcedureOutput;
Or even worse having to setup an OpenQuery
Insert Into #actual
OpenQuery(@LocalDatabase, 'Exec Example.ProcedureOutput');
This has been on the backlog for a while. However, it is not trivial as SQL Server does not allow to create temp tables inside a procedure and have them accessible outside. So, we are really talking about extending the T-SQL language itself. If you have a good idea of how to implement this, let me know.