WITH cte_name [(column_name_1, column_name_2, ...)] AS (cte_expression)
It is necessary to separate a CTE from the previous statement with a semi-colon (;) character.
i.e. ;WITH CommonTableName (...) SELECT ... FROM CommonTableName ...
A CTE's scope is a single batch, and only downstream ...