Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon

Use a comma to separate CTEs

;WITH SomeClause1 AS
(
  SELECT ....
)
, SomeClause2 AS
(
  SELECT ....
)

Leave a Comment