I'm new to connecting to databases hosted in SQL Server.
The following code works:
library(DBI)
con <- dbConnect(odbc::odbc(), .connection_string = "Driver={SQL Server};",
user = rstudioapi::askForPassword("Your computer usename e.g. SmithJo"),
password = rstudioapi::askForPassword("Your computer password (e.g. to login to Windows)"),
port = 1433,
server = "myserver",
dbname = "ABC")
However, the connections pane then shows a number of databases:
When I use the command dbListTables(con)
, are the tables listed JUST from database ABC?