I am using sqlparse to analyze some queries from 100+ SSRS reports. There are situations where a single dataset will contain multiple queries. One example would be when using a temp table; there could be a SELECT INTO #temp followed by another SELECT statement. In these cases, if the first query does not terminate with a semicolon then sqlparse appears to group the WHERE from the first query and all remaining sql together.
Instead of
The best answer would be to write more precise SQL. Unfortunately, since I am using sqlparse to do analysis on other people's work, I need to find a way to account for this. I have tried splitting the queries before parsing, but split() appears to rely on the ';' as well. This looks like it takes place in StatementFilter.Process().
Is this a bug, or expected behavior? I would appreciate any suggestions.