Incorrect syntax near '%1!s!'. If this is intended to be a common table expression, you need to explicitly terminate the ...