I have a CDM based in SQL Server (in azure) named “myorg-db-omop”. Because it has the dashes in the name I have to include brackets around that name when I refer to it or any schema within it like this in R:
cdmDatabaseSchema ← “[myorg-db-omop].dbo”
cohortDatabaseSchema ← “[myorg-db-omop].results”
cohortTable ← “my_study_cohorts”
However running the execute command for the Corazon package returns this error in errorReportSql.txt which implies that for some reason, the brackets have been dropped even though the SQL below it includes those brackets.
Does anyone know what is going on here? Running the IF … DROP… statements in the error report’s SQL code works when I submit it to the database directly in SQL Server.
from errorReportSql.txt:
Error:
com.microsoft.sqlserver.jdbc.SQLServerException: Reference to database and/or server name in ‘myorg-db-omop.results.my_study_cohorts’ is not supported in this version of SQL Server.
SQL:
IF OBJECT_ID(’[myorg-db-omop].results.my_study_cohorts’, ‘U’) IS NOT NULL
DROP TABLE [myorg-db-omop].results.my_study_cohorts
R version:
R version 4.2.2 (2022-10-31 ucrt)
Platform:
x86_64-w64-mingw32
Attached base packages:
- stats
- graphics
- grDevices
- utils
- datasets
- methods
- base
Other attached packages:
- corazon (0.0.1)
- DatabaseConnector (6.0.0)