我不熟悉连接到SQL Server中托管的数据库。
以下代码有效:
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")
当我使用命令dbListTables(con)
时,表刚从数据库ABC中列出吗?