This used to work:
library("dbplyr")
cn <- DBI::dbConnect(odbc::odbc(), .connection_string = "Driver={SQL Server};server=servername;trusted_connection=yes;")
dplyr::tbl(cn, dbplyr::in_schema(dbplyr::sql("database.dbo"), dbplyr::sql("table_name")))
But now gets this error message:
Caused by error:
! nanodbc/nanodbc.cpp:1769: 42000: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'database.dbo.table_name'. [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.
<SQL> 'SELECT *
FROM "database.dbo"."table_name" "q01"
WHERE (0 = 1)'
The update to 2.0 also broke our queries that included the database name within in_schema (see #552), and we've been using this workaround since then, but now the workaround is broken. Any chance this is something that would get fixed? The issue is the extra quotes around the . after dbo, i.e. the query should be:
'SELECT *
FROM "database.dbo.table_name" "q01"
WHERE (0 = 1)'
Reverting to 2.3.4 fixes it.
This used to work:
But now gets this error message:
The update to 2.0 also broke our queries that included the database name within in_schema (see #552), and we've been using this workaround since then, but now the workaround is broken. Any chance this is something that would get fixed? The issue is the extra quotes around the . after dbo, i.e. the query should be:
Reverting to 2.3.4 fixes it.