0

Can I use a stored procedure as the CTE_query_definition of a CTE?

For example:

WITH  CodesCTE
AS ( Exec sp_TableReturningProc )
SELECT * FROM CodesCTE;

If not, outside of declaring a batch / global temp table and using a Select statement against the temp table, is there a way around this limitation?

I am in the process of developing the associated stored procedure and would love to simply the use of it for this purpose if possible.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
GoldBishop
  • 2,663
  • 4
  • 47
  • 77

0 Answers0