Skip to content

Instantly share code, notes, and snippets.

@daattali
Last active October 19, 2017 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daattali/8772dcd5cdc7c13b76ea99bee100113b to your computer and use it in GitHub Desktop.
Save daattali/8772dcd5cdc7c13b76ea99bee100113b to your computer and use it in GitHub Desktop.
connecting to SQL Server external vs local
# production
dbConnect(
RSQLServer::SQLServer(),
server = config$server,
database = config$database,
properties = list(
user = config$uid,
password = config$pwd
)
)
# local
# 'server' changes to 'Server'
# 'database' changes to 'Database'
# properties isn't required
# Driver is required
# drv is different
dbConnect(
odbc::odbc(),
Driver = "{SQL Server}",
Server = config$server,
Database = config$database
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment