1. library(RODBC)
    2. dbconnection <- odbcDriverConnect("Driver=ODBC Driver 11 for SQL Server;
    3. Server=YourDBName\\SQLEXPRESS;
    4. Database=TestDB;
    5. Uid=;
    6. Pwd=;
    7. trusted_connection=yes")
    8. initdata <- sqlQuery(dbconnection,paste("select * from MyTable;"))
    9. odbcClose(dbconnection)