How to import SQL read only database


I'm trying to connect to a SQL server database from R. The database is read only, will I still be able to do that? I have tried the following code, but it's not working for some reason.

dbconnection <- dbConnect(odbc(),
                                  Driver="SQL Server",
                          Authentification="SQL Server Authentification")

Thank you :slight_smile:


it is perfectly normal to connect to databases with only read access. In fact you probably do not wish for a write access to a production dabatase; knowing you can not break anything come what may is kind of liberating :slight_smile:

The approach you are taking is in princple a correct one, but you do not give us enough information to help. What error message do you get? Have you loaded all libraries required? dbConnect is from {DBI} and odbc from {odbc}.

1 Like

If you are on Windows, you could define a DSN in your ODBC-Source-Settings (e.g.: and then connect with:

                    dsn      = "DSN_NAME",
                    database = "DATABASE_NAME",
                    encoding = "",

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.