Skip to main content

SQLServer

Library of functions for accessing Microsoft SQL Server.

Functions

InferAndQuery

Performs a query in a SQLServer database with schema detection (inference).

Syntax:
SQLServer.InferAndQuery(database: string, query: string, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • query: The query to execute in the database.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the SQL Server table.
Example:
SQLServer.InferAndQuery("database", "SELECT * FROM schema.table")

InferAndRead

Reads a SQLServer table with schema detection (inference).

Syntax:
SQLServer.InferAndRead(database: string, schema: string, table: string, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • schema: The database schema name.

  • table: The name of the table.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the SQL Server table.
Example:
SQLServer.InferAndRead("database", "schema", "table")

Query

Performs a query in a SQLServer database.

Syntax:
SQLServer.Query(database: string, query: string, type: type, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • query: The query to execute in the database.

  • type: The type of the query result.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the SQL Server table.
Example:
SQLServer.Query("database", "SELECT a, b FROM schema.table", type collection(record(a: int, b: string)))

Read

Reads a SQLServer table.

Syntax:
SQLServer.Read(database: string, schema: string, table: string, type: type, host: optional string, port: optional int, username: optional string, password: optional string)
Parameters
  • database: The name of the database to read. If the database credentials are stored in the credentials storage, then this parameter receives the name of the credential.

  • schema: The database schema name.

  • table: The name of the table.

  • type: The type of the table.

  • host: The database server hostname. Can only be used if not using registered credentials.

  • port: The database server port. Can only to be used together with 'host' argument.

  • username: The database user name. Can only to be used together with 'host' argument.

  • password: The database user password. Can only to be used together with 'host' and 'username' arguments.

Returns
  • collection: A table with the data read from the SQL Server table.
Example:
SQLServer.Read("database", "schema", "table", type record(id: int, name: string, salary: double))