Connections tab: error after Table access by clicking on icon, (MS SQLServer)


#1

I’m on Linux. R v3.4.3, rstudio v 1.1.423, unixodbc installed, R odbc package installed.

I have an ODBC Data source configured properly, I can access MS SQL Server with my R code inside a chunk within an Rmd file.

However when I try to connect using the rstudio GUI tools it does not work.

What I do is:

Connections pane - open connections - open schemas/catalogs (expand blue icon from > to v) - click on table icon.

When I try to access a table by clicking on the table icon, I get a dialog box similar to a javascipt alertbox, saying “R code execution error”, and in the rstudio console tab, there appears this:

Error: <SQL> 'SELECT * FROM "bcdp"."dbo"."BCDP_BOXES"'
  nanodbc/nanodbc.cpp:1587: 42000: [FreeTDS][SQL Server]Incorrect syntax near 'bcdp'.

This SQL code is principally correct, it’s the double-quotes that the MS SQL Server does not understand.

Can I configure Rstudio somewhere to NOT inject these quotes?


#2

RStudio itself does not produce that SQL query; it is produced by the odbc package (which acts as a kind of plug-in to provide ODBC data to the Connections pane and associated data views). You might ask over there, or file an issue if it appears to be a bug.