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
  • 732,580
  • 175
  • 1,330
  • 1,459
GoldBishop
  • 2,820
  • 4
  • 47
  • 82

0 Answers0