WITH CteProductLookup(ProductId, oid) AS ( SELECT p.ProductID, p.oid FROM [dbo].[ME_CatalogProducts] p ) When We Encounter This Kind of Problem, Just Add a Semicolon before the WITH.