Search code examples
rrodbc

SQL Server RODBC Connection


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

Thank you.


Solution

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