Create a SQLServer driver

This creates a SQL Server driver used to access SQL Server databases and is based on the jTDS driver.

Connect to/disconnect from a SQL Server database.

SQLServer(identifier.quote = "\"")
"dbConnect"(drv, server, file = NULL, database = "", type = "sqlserver", port = "", properties = list())
quote character for a SQL Server identifier can be a double quotation mark (\") which is the default.
An objected of class SQLServerDriver, or an existing SQLServerConnection. If a connection, the connection will be cloned.
the server address or recognised alias thereof.
defaults to using the server details file in $HOME/sql.yaml. The server details including type, port and any optional properties can be sourced from this file. If the server name is found in file, the details therein are used (and in particular, those provided in other arguments to this function are ignored). The connection method prefers server details to be provided in a "sql.yaml" file rather than provided as arguments to this function. If you wish to specify the details as parameters, ensure that either the file does not exist or that the server details are not in the YAML file.
the name of the database hosted on the server. If an empty string, a connection to the default database on server is assumed.
the server type. Must be either "sqlserver" or "sybase". Defaults to "sqlserver".
the TCP/IP default port. This will be coerced to a string. Defaults to 1433 if an empty string (jTDS behaviour).
One or more optional connection properties. in a named list. Note if you intend to set the useNTLMv2 property to 'true' from the default API value of 'false', you will need to make a specific authentication driver available to the SQL Server driver, although this hasn't worked particularly well in testing. See RSQLServer for more details. Should you wish to use Windows authentication to connect to the server, I recommend you set the following optional parameters: set useNTLMv2 to 'true', domain to your domain and user and password to your username and password on domain. jTDS' SSO functionality is flaky.

An object of class SQLServerDriver.a SQLServerConnection


jTDS project

  • SQLServer
  • dbConnect,SQLServerDriver-method
## Not run: 
# SQLServer()
# ## End(Not run)
# View sql.yaml file bundled in package
file <- system.file("extdata", "sql.yaml", package = "RSQLServer")
# Connect using ~/sql.yaml file
## Not run: 
# if (have_test_server()) {
#  dbConnect(RSQLServer::SQLServer(), "TEST")
# }
# # Example where ~/sql.yaml does not exist or where the server
# # is not in the YAML file.
# dbConnect(RSQLServer::SQLServer(), server="", port=1434,
#    properties=list(useNTLMv2="true", domain="myco", user="me",
#      password="asecret"))
# ## End(Not run)
Documentation reproduced from package RSQLServer, version 0.2.0, License: GPL-2

Community examples

Looks like there are no examples yet.