I have a CTErequest for this
;With CTE_Table as (SELECT ...)
Select * from CTE_Table
Now I am trying to save this result in table variableor temporary table. If i try
Declare @Table table
(...)
INSERT INTO @Table (...)
HER I PUT THE CODE ABOVE
I get incorrect syntax erroraround the operator WITH. I assume that the team Insert Intoexpects Select statementinstead ;WITH, as well as for Create Table. I was looking for solutions, but everything I found did not turn on Select statementafter ;WITH. How to get the output shown above in temporary tableor table variable?
I am using SQL Server 2014.
source
share