I am trying to test the odbc package on Microsoft SQL Server, however the problem I face is it only returns zero rows even though there is data in the table, say I execute the query with Visual Studio.
Could anybody please help, googling for the answers is difficult because it keeps finding results pertaining to RODBC not odbc.
Here is the code, I have masked the server name etc for security purposes. Apologies for not being able to produce a different reprex.
library(DBI) con <- DBI::dbConnect(odbc::odbc(), Driver = "SQL Server Native Client 11.0", Server = "<server>", Database = "<database>", UID = "<username>", PWD = "<password>", Port = 00000) dbGetQuery(con, "SELECT TOP 1000 * FROM [DATABASE].[dbo].[TABLE]") DBI::dbDisconnect(con) <0 rows> (or 0-length row.names)