Last active
March 4, 2019 19:44
-
-
Save bradlindblad/d40333fedf8755f943ff300fbb0d5844 to your computer and use it in GitHub Desktop.
get_customers.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_customers <- function() { | |
#' Pull most recent customer data from G23 - datascience.agc_Customers | |
require(odbc) | |
con <- dbConnect(odbc(), | |
Driver = "SQL Server", | |
Server = "datas", | |
Database = "dataserver", | |
UID = "user", | |
PWD = rstudioapi::askForSecret("password"), | |
Port = 6969) | |
query1 <- "SELECT * FROM datas.dbo.Customers" | |
z <- odbc::dbGetQuery(con, query1) | |
return(z) | |
odbc::dbDisconnect(con) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment