Skip to main content

Microsoft SQL Server

Microsoft SQL Server is a database server for storing and retrieving data.

Prerequisites

Ensure that you have the following details before configuring SQL Server as a source:

  • Hostname or IP address of the database
  • Port
  • Ensure that the database version is SQL Server version 2012 or later.

Configuring SQL Server as a Source

Perform these steps to configure SQL Server as a source:

  1. On the Datasets page, you can see a truncated list of Sources at the bottom-left of the page. Click Add Source.

    Alternatively, click Databases. The page displays all database sources. Click the Add database button at the top-right of that page.

  2. In the Add Data Source dialog, click Microsoft SQL Server.

    The following section describes the source configuration tabs.

General

The General tab contains the required fields to create a SQL Server source.

Perform these steps in the General tab:

  1. In the General tab, for Name, enter a name.
  2. For Host, enter the SQL Server host name.
  3. For Port, enter the SQL Server port number. The default port is 1433.
  4. (Optional) For Database, enter the SQL Server database name.
  5. (Optional) For Encrypt connection, enable encrypted connections to SQL Server using SSL.
  6. For Authentication, Master Authentication is the default and the only option. Provide the username and password of a master database user with permissions to read required objects:
  • For Username, enter your SQL Server database username.
  • For Password, enter your SQL Server database password.

Advanced Options

Click Advanced Options in the sidebar.

note

All advanced options are optional.

Advanced OptionDescription
Show only the initial database used for connectingIf selected, hides the other databases that the credential has access to.
Record fetch sizeNumber of records to fetch at once. Set to 0 (zero) to have Sonar automatically decide. The default record fetch size is 200.
Maximum Idle ConnectionsThe total number of connections allowed to be idle at a given time. The default maximum idle connections is 8.
Connection Idle TimeThe amount of time (in seconds) allowed for a connection to remain idle before the connection is terminated. The default connection idle time is 60 seconds.
EncryptionVerify Server Certificate is enabled. Add an SSL/TLS server certificate distinguished name in the text box.
Connection PropertiesCustom key value pairs for the connection relevant to the source. To add a connection property, click Add property and add the property name and value.

Reflection Refresh

The Reflection Refresh tab in the sidebar allows you to set time intervals for reflections to refresh or expire.

Metadata

You can configure settings to refresh metadata and handle datasets. Click Metadata in the sidebar.

You can configure Dataset Handling and Metadata Refresh parameters.

Dataset Handling

These are the Dataset Handling parameters.

note

All Dataset Handling parameters are optional.

ParameterDescription
Remove dataset definitions if underlying data is unavailableBy default, Sonar removes dataset definitions if underlying data is unavailable. Useful when files are temporarily deleted and added back in the same location with new sets of files.
Metadata Refresh

These are the Metadata Refresh parameters:

  • Dataset Discovery: The refresh interval for fetching top-level source object names such as databases and tables. Set the time interval using this parameter.

    ParameterDescription
    (Optional) Fetch everyYou can choose to set the frequency to fetch object names in minutes, hours, days, or weeks. The default frequency to fetch object names is 1 hour.
  • Dataset Details: The metadata that Sonar needs for query planning such as information required for fields, types, shards, statistics, and locality. These are the parameters to fetch the dataset information.

    note

    All Dataset Details parameters are optional.

ParameterDescription
Fetch modeYou can choose to fetch only from queried datasets that are set by default. Sonar updates details for previously queried objects in a source. Fetching from all datasets is deprecated.
Fetch everyYou can choose to set the frequency to fetch dataset details in minutes, hours, days, or weeks. The default frequency to fetch dataset details is 1 hour.
Expire afterYou can choose to set the expiry time of dataset details in minutes, hours, days, or weeks. The default expiry time of dataset details is 3 hours.

Privileges

You can grant privileges to specific users or roles.

  1. (Optional) For Privileges, enter the user name or role name that you want to grant access to and click the Add to Privileges button. The added user or role is displayed in the Users table.
  2. (Optional) For the users or roles in the Users table, toggle the green checkmark for each privilege you want to grant to the SQL Server source that is being created.

Click Save after setting the configuration.

Editing a SQL Server Source

To edit a SQL Server source:

  1. On the Datasets page, click Databases. A list of databases is displayed.

  2. Hover over the database and click Settings that appears next to the database.

  3. In the Source Settings dialog, you cannot edit the name. Editing other parameters is optional.

  4. Click Save.

Removing a SQL Server Source

To remove a SQL Server source, perform these steps:

  1. On the Datasets page, click Databases. A list of sources is displayed.

  2. Hover over the source and click the More (...) icon that appears next to the source.

  3. From the list of actions, click Remove Source. Confirm that you want to remove the source.

    caution

    Removing a source causes all downstream views dependent on objects in this source to break.

Predicate Pushdowns

Dremio offloads these operations to SQL Server.

*, +, -, /, %
<, <=, <>, =, >, >=, !=
AND, NOT, OR, ||
ABS
ACOS
ADD_MONTHS
ASIN
ATAN
ATAN2
AVG
CAST
CEIL
CEILING
CHAR_LENGTH
CHARACTER_LENGTH
CONCAT
COS
COT
DATE_ADD
DATE_SUB
DATE_TRUNC_DAY
DATE_TRUNC_HOUR
DATE_TRUNC_MINUTE
DATE_TRUNC_MONTH
DATE_TRUNC_YEAR
DEGREES
E
EXP
EXTRACT_DAY
EXTRACT_DOW
EXTRACT_DOY
EXTRACT_HOUR
EXTRACT_MINUTE
EXTRACT_MONTH
EXTRACT_QUARTER
EXTRACT_SECOND
EXTRACT_WEEK
EXTRACT_YEAR
FLOOR
IS DISTINCT FROM
IS NOT DISTINCT FROM
IS NOT NULL
IS NULL
LAST_DAY
LCASE
LEFT
LENGTH
LIKE
LN
LOCATE
LOG
LOG10
LOWER
LPAD
LTRIM
MAX
MEDIAN
MIN
MOD
MONTH
PERCENT_CONT
PERCENT_DISC
PI
POSITION
POW
POWER
RADIANS
RAND
REPLACE
REVERSE
RIGHT
ROUND
RPAD
RTRIM
SIGN
SIN
SQRT
SUBSTR
SUBSTRING
SUM
TAN
TIMESTAMPADD_DAY
TIMESTAMPADD_HOUR
TIMESTAMPADD_MINUTE
TIMESTAMPADD_MONTH
TIMESTAMPADD_QUARTER
TIMESTAMPADD_SECOND
TIMESTAMPADD_YEAR
TIMESTAMPDIFF_DAY
TIMESTAMPDIFF_HOUR
TIMESTAMPDIFF_MINUTE
TIMESTAMPDIFF_MONTH
TIMESTAMPDIFF_QUARTER
TIMESTAMPDIFF_SECOND
TIMESTAMPDIFF_WEEK
TIMESTAMPDIFF_YEAR
TO_DATE
TRIM
TRUNC
TRUNCATE
UCASE
UPPER
YEAR

note

Since SQL Server has no boolean type, project operations that contain SQL expressions which evaluate to true or false (e.g. SELECT username, friends > 0), and filter operations that include boolean literals in a filter (e.g. WHERE currentAccount = true) cannot be executed as pushdowns.