[R] Connection to Microsoft SQL Server

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon May 18 14:23:10 CEST 2009

Meenu Sahi wrote:
> Dear Users
> I am new to R. I'm trying to make a connection to Microsoft SQL Server via
> R.
> How can I find the correct syntax to make the connection? The Help pdf file
> has an example for mySql but there's isnt much on SQL Server.
> Please help.
> I am trying the following code
> library(RODBC)
> con<-odbcConnect(dbname,hostname)
> How do I specify the driver,userid,password etc?

Well, you specify the DSN and other details in your Windows settings 
(somewhere within the control panel) - given your OS is Windows?
If you make a call to connect to that DSN, you will be asked for 
username and password given you haven't specified it with the DSN in 
your Windows settings.

Uwe Ligges

> Many thanks for your help!
> Me.
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list