Regarding SELECT INTO in SQL Server
The following throw an error Incorrect syntax near ')'.
SELECT * INTO Sales.MyTable FROM
(SELECT TOP(100) * FROM Sales.Customer)
The following will pass
With tempCust AS
(
SELECT TOP(100) * FROM Sales.Customer
)
SELECT * INTO Sales.MyTable FROM tempCust
What is the rule behind that ?