- Instructions to connect to Partners MS SQL servers from Partners Rstudio (rstudio.partners.org)
- You have to have access ready for the SQL server that you want to connect to.
- You need to know the database server name. You do not have to set the database name.
In this example, we are trying to connect to phssql826.partners.org as user hp911
- Open any text editor and paste the following
Driver = FreeTDS
Server = phsedw.partners.org
Port = 1433
TDS_Version = 8.0
- Save as “.odbc.ini”. Do not forget the leading dot.
- Open Partners Rstudio and upload this file to your home directory.
- Quit the current session and start new session
- Let’s test in R console (rstudio.partners.org)
>odbc <- odbcConnect("phsedw", "Partners\\hp911", .rs.api.askForPassword("password"))
>dat <- sqlQuery(odbc, "## your query here ##")