mssql: Get response from Microsoft SQL Server

Description Usage Arguments Details Value See Also Examples

View source: R/mssql.R

Description

Send SQL-query and get server response as data.table

Usage

1
2
mssql(con,
  query = "SELECT 200 AS Response, CURRENT_TIMESTAMP AS Relevance")

Arguments

con

connection object of class mssql_connection of sqsh command.

query

valid SQL-expression as character

Details

Connection problems are mostly processed and diagnostics is returned as data.table. Error codes are HTTP status codes.

Value

Microsoft SQL server response as data.table

See Also

mssql_connection for creating connection object

Other Database: mssql_connection

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Create connection object:
conn <- mssql_connection(server = "10.100.104.142", domain = "SUEK",
 user = "user", password = "password")

# Ask for data:
 mssql(conn, "SELECT 200 AS V1, 300 AS V2")

# Output:
 #     V1  V2
 # 1: 200 300

## End(Not run)

omega1x/sqshr documentation built on April 8, 2020, 12:11 a.m.