Skip to content

Instantly share code, notes, and snippets.

@renatocantarino
Created August 6, 2013 13:33
Show Gist options
  • Save renatocantarino/6164449 to your computer and use it in GitHub Desktop.
Save renatocantarino/6164449 to your computer and use it in GitHub Desktop.
Conecta no SQL e realiza Query.
library(RODBC)
cn<-odbcConnect('NW',uid='Usuario',pwd='Senha')
sql <- "select top 30 ShipName from dbo.Orders"
myresult<- (sqlQuery(cn, sql))
odbcClose(cn)
print(myresult)
@renatocantarino
Copy link
Author

NW = nome do Odbc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment