Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon August 5, 2023 by Tarik Use a comma to separate CTEs ;WITH SomeClause1 AS ( SELECT .... ) , SomeClause2 AS ( SELECT .... )