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 Microsoft SQL Server as a source:
- Hostname or IP address of the database
- Port
- Outbound port (1433 is the default port) open in your AWS or Azure security group
- Ensure that the database version is Microsoft SQL Server version 2012 or later
User Impersonation
The Microsoft SQL Server username provided in the source configuration is the default username that is used for running queries. When queries are run against Microsoft SQL Server in Dremio Cloud, users use the privileges associated with the Microsoft SQL Server username and run queries under that username.
You can change this default in Dremio Cloud by enabling user impersonation in the Advanced Options, which allows users to run queries under their own usernames and restricts their access. For example, user_1
can run queries as user_1
rather than sqlsvr_svc
. Before enabling user impersonation, some setup is required in Microsoft SQL Server to allow one user to impersonate another user because the username of the user in Dremio Cloud must be the same as their username in Microsoft SQL Server and the user must be able to connect through the Microsoft SQL Server username.
To set up user impersonation, follow these steps:
-
Ensure the user's username in Microsoft SQL Server matches their username in Dremio Cloud. If the usernames do not match, modify one of the usernames or create a new user account with a matching username.
-
Run a GRANT IMPERSONATE command in Microsoft SQL Server to allow the user to connect through their Microsoft SQL Server username:
GRANT IMPERSONATE ON USER::testuser1 TO proxyuser;
In this example, the user can log in as testuser1
in Dremio Cloud and in Microsoft SQL Server, and they can connect through the proxyuser
. The proxyuser
is the Microsoft SQL Server username provided in the source configuration.
-
Log in to Dremio Cloud as a member of the ADMIN role.
-
Follow the steps for Configuring Microsoft SQL Server as a Source using the Microsoft SQL Server username
proxyuser
and enable User Impersonation in the Advanced Options. -
Grant source privileges to the user.
Now that you have enabled user impersonation, a user who logs in to Dremio Cloud with their username can access the Microsoft SQL Server source and its datasets according to their privileges. The user can also run queries against Microsoft SQL Server under their username.
Configuring Microsoft SQL Server as a Source
Perform these steps to configure Microsoft SQL Server as a source:
-
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.
-
In the Add Data Source dialog, click Microsoft SQL Server.
The following section describes the source configuration tabs.