dosubot[bot] commented on issue #31913: URL: https://github.com/apache/superset/issues/31913#issuecomment-2599278456
<!-- Greeting --> Hey @huafist! 👋 I'm here to help you with any bugs, questions, or contributions you have for Superset. I'm a bot designed to assist you while you wait for a human maintainer. Let's tackle this issue together! <!-- Answer --> The issue you're encountering with the `DECLARE` statement in MSSQL when creating charts in Superset might be related to how Superset processes SQL queries for chart creation. While I couldn't find specific documentation on handling `DECLARE` statements, there are some configurations and settings in Superset that might affect query execution. 1. **SQL Parsing and Execution**: Superset might handle SQL parsing differently when creating charts compared to running queries in SQL Lab. This could lead to syntax errors if certain SQL constructs are not supported in the chart creation context. 2. **Configurations Affecting Query Execution**: There are configurations like `SQLLAB_TIMEOUT`, `SQLLAB_HARD_TIMEOUT`, and `SQL_MAX_ROW` that can impact query execution, but these are more related to time limits and row constraints rather than syntax issues <sup>[[1]](https://github.com/apache/superset/blob/master/superset/sql_lab.py)</sup>. 3. **MSSQL Specific Configurations**: Recent updates have introduced improvements for MSSQL, such as supporting CTE in virtual tables and respecting the `datefirst` setting. However, these changes might not directly address the `DECLARE` statement issue <sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/CHANGELOG.md)</sup>. To work around this issue, consider restructuring your query to avoid using `DECLARE` statements at the beginning, or try using alternative methods to set variables, such as using subqueries or CTEs. Additionally, ensure that any temporary tables are handled correctly within the query context. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/38ae18d7-f5f5-4047-88c2-7b4188678640?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/38ae18d7-f5f5-4047-88c2-7b4188678640?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/38ae18d7-f5f5-4047-88c2-7b4188678640?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/38ae18d7-f5f5-4047-88c2-7b4188678640?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/38ae18d7-f5f5-4047-88c2-7b4188678640?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/38ae18d7-f5f5-4047-88c2-7b4188678640?feedback_type=other)</sup> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org