Replies: 1 comment 3 replies
-
It's currently intentional that it gets dropped from statements. it'd be no different than a comment there, as it does not really serve a purpose to the statement, and if anything would belong to the preceeding statement, or be a standalone No-Op statement. I understand that the language guidance has all CTE's be prefixed with it, but that's really just a workflow hack. You can run the statement without a semicolon, as long as there's no preceeding statement or the preceeding statement is ended with a semicolon, which is a long standing breaking change deprecation path requirement anyways. It'll be a really strange solution in the code to make it work another way, especially since CTE's already have an odd flow that shows that they kind of go against the language base structure of having the first word identify the command. I'm always up for discussing however. What issue does it cause you? Are you needing to replay 100% characters from the original script? |
Beta Was this translation helpful? Give feedback.
-
Hi Bruce,
Recently parsing some of the queries I have seen involving CTE WITH keyword. For queries start with the WITH keyword (first token in the entire script), it is fine. However, if the WITH is not the very first token, the parser seems to remove the leading semicolon which invalids the entire script.
For example, the following demo script shows the problem:
The above script has semicolon for each statement. Also an extra semicolon was added in front of the WITH. But after parsing, it seems all semicolon were removed which makes the WITH invalid.
Is there a way to retain the semicolon while parsing the script?
Thank you very much.
Paul
Beta Was this translation helpful? Give feedback.
All reactions