Skip to content

Error when creating cohort tables using executeSql() on Microsoft SQL Server #335

Description

@bdj5051

Hi,

I'm trying to run the Strategus package with Microsoft SQL Server, but I'm getting the following error when running the CohortGenerator module:

Error executing SQL:

com.microsoft.sqlserver.jdbc.SQLServerException: A result set was generated for update.

I found that this error occurs when createCohortTables() from the CohortGenerator package executes executeSql().

It seems that when a CREATE TABLE statement is executed, SQL Server returns a result set, which causes this error in R/JDBC.

I temporarily fixed this issue by using querySql() instead of executeSql() when executing a CREATE TABLE statement.

Is there any known workaround, or does anyone know why this happens?

Environment:

R version: 4.4.3 (2025-02-28 ucrt)
Platform: x86_64-w64-mingw32/x64
OS: Windows Server 2022 x64 (build 20348)

CohortGenerator version: 1.1.0
DatabaseConnector version: 7.1.0
Java version: 17.0.13

DBMS: Microsoft SQL Server

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions