Das sind die Fehlermeldungen:
Meldung 156, Ebene 15, Status 1, Zeile 7
Incorrect syntax near the keyword 'WITH'.
Meldung 319, Ebene 15, Status 1, Zeile 7
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
Meldung 102, Ebene 15, Status 1, Zeile 13
Incorrect syntax near ','.
Meldung 102, Ebene 15, Status 1, Zeile 28
Incorrect syntax near ')'.