-1006 WITH is an incorrect keyword for this statement
Possible Cause
A WITH clause was used as part of a dynamic SELECT request. WITH may not be used for a SELECT request.
Possible Solution
Remove the WITH clause from the request.
A WITH clause was used as part of a dynamic SELECT request. WITH may not be used for a SELECT request.
Remove the WITH clause from the request.