Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
6.6.2, 6.8.0
Description
When using QSqlQuery::prepare to create a temporary SQL table with the command "CREATE TABLE <#tmpTable>(id int NOT NULL)", followed by executing it with QSqlQuery::exec() on Microsoft SQL Server, no error is returned. However, when inserting data into the temporary SQL table afterward using "INSERT INTO <#tmpTable>(id) VALUES", an error occurs, stating that the temporary SQL table does not exist.
On the other hand, if the temporary SQL table is created using QSqlQuery::exec("CREATE TABLE <#tmpTable>(id int NOT NULL)") without QSqlQuery::prepare, subsequent data insertion into the temporary SQL table works as expected.
To reproduce the issue, set the command to connect to the database, and then run the attached example project.