TSQL Common table expression getting incorrect syntax near )


This message is really not helpful at all.

Say if you create a common table expression that does not immediate follow by a query, you get this nice error, for example :-


WITH MyDataCTE (Id, SecurityID)
AS
(  
 SELECT [Identity] as Id, SecurityID FROM [Ids_staging].dbo.[StageJPMorganValuationReport] WHERE batchId = 38969
)

SELECT * FROM MyDataCTE  /// Without this line here, you get this error.





Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm