Reading data from Microsoft SQL Server into R

前端 未结 7 569
长发绾君心
长发绾君心 2021-02-01 02:17

Is it possible to read the data stored in MS SQL server from R interface?

If it is I would be also thankful if anyone could show the way to do it.

相关标签:
7条回答
  • 2021-02-01 03:04

    I've applied RODBC function suggested by other users. LinkSQL Server RODBC Connection

    library(RODBC)
    dbhandle <- odbcDriverConnect('driver={SQL 
    Server};server=mysqlhost;database=mydbname;trusted_connection=true')
    res <- sqlQuery(dbhandle, 'select * from information_schema.tables')
    

    change two variables based on your Data table. 'server=mysqlhost;database=mydbname'

    0 讨论(0)
提交回复
热议问题