SQL Server RODBC Connection

后端 未结 5 625
滥情空心
滥情空心 2020-11-28 03:10

Does anyone have a connection string example for using RODBC and connecting to MS SQL Server 2005 or 2008.

Thank you.

5条回答
  •  眼角桃花
    2020-11-28 03:51

    First You have to Create/configure DSN (ODBC connection with specific DB)

    Then install RODBC library.

    library(RODBC)
    myconn <-odbcConnect("MyDSN", uid="***", pwd="*******")
    
    fetchData<- sqlQuery(myconn, "select * from tableName")
    View(fetchData)
    close(myconn)
    

提交回复
热议问题