问题
I am on macOS Catalina (Version 10.15.1), running R 3.5.0. I am running SQL server on Docker locally. For connecting to the server, I am using odbc
:
con <- dbConnect(odbc(),
Driver = "Simba SQL Server ODBC Driver",
Server = "localhost",
UID = 'SA',
PWD = 'XXXXXXXX',
database = dbname)
I am able to connect to the server, however the names of all the databases therein are getting truncated to just the first letter as shown here:
Subsequently all the character columns are also showing only the first letter.
I had a look at this, but just can't figure out why this is happening. For starters, the names of the databases itself, as shown in the RStudio Connections pane, are getting truncated.
I am able to connect to the databases using Azure Data Studio and see all the columns correctly.
回答1:
I had a look at this and turns out this was exactly what I was facing. Followed the steps mentioned here to resolve the issue.
来源:https://stackoverflow.com/questions/58777915/truncation-of-database-name-and-columns-while-connecting-to-sql-database-from-r