# SQL Server



# SQL Server Connector

## Introduction

### Description

The SQL Server connector allows an easy way to configure and manage Microsoft SQL Server relational databases.

### Managed System

This connector is specific for integration with the Microsoft SQL Server.

<div class="pointer-container" id="bkmrk-%C2%A0"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div><p class="callout info">For more information to check if your system may be synchronized with this connector, do not hesitate to contact us through our [Contact form](http://www.soffid.com/contactform/)</p>

We can also manage more relational databases, for more information you can check the [List of relational databases](https://en.wikipedia.org/wiki/List_of_relational_database_management_systems).

### Prerequisites

It is needed a user with access and permissions to the schemes and tables required in the scope of the integration.

## Download and Install

This addon is located in the Connectors section and its name is **SQLServer**.

<div class="pointer-container" id="bkmrk-%C2%A0-0"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div><p class="callout info">For more information about the installation process, you can visit the [Addons Getting started](https://bookstack.soffid.com/books/addons-getting-started/page/getting-started "Addons installation") page.</p>

## Agent Configuration

This connector could manage User and Role objects.

### Basic

#### Generic parameters

After the installation of the addon, you may create and configure agent instances.

To configure this SQL Server connector you must select "SQLServer agent" in the attribute "Type" of the generic parameters section in the agent's page configuration.

<p class="callout info">For more information about how you may configure the generic parameters of the agent, see the following link: [Agents configuration](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/agents "Agents")</p>

[![image-1704443217219.png](https://bookstack.soffid.com/uploads/images/gallery/2024-01/scaled-1680-/image-1704443217219.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-01/image-1704443217219.png)

#### Custom parameters

Below there are the specific parameters for this agent implementation:

<div id="bkmrk-parameter-descriptio"><table class="confluenceTable tablesorter tablesorter-default stickyTableHeaders" role="grid" style="width: 100%; height: 489.4px;"><thead class="tableFloatingHeaderOriginal"><tr class="tablesorter-headerRow" role="row" style="height: 35.4px;"><th aria-disabled="false" aria-label="Parameter: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="0" role="columnheader" scope="col" style="width: 22.5926%; height: 35.4px;" tabindex="0">**Parameter**

</th><th aria-disabled="false" aria-label="Description: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="1" role="columnheader" scope="col" style="width: 77.284%; height: 35.4px;" tabindex="0">**Description**

</th></tr></thead><tbody aria-live="polite" aria-relevant="all"><tr role="row" style="height: 35.4px;"><td class="confluenceTd" style="width: 22.5926%; height: 35.4px;">User

</td><td class="confluenceTd" style="width: 77.284%; height: 35.4px;">Database user name to authenticate

</td></tr><tr role="row" style="height: 35.4px;"><td class="confluenceTd" style="width: 22.5926%; height: 35.4px;">Password

</td><td class="confluenceTd" style="width: 77.284%; height: 35.4px;">The password of the database user

</td></tr><tr role="row" style="height: 80.2px;"><td class="confluenceTd" style="width: 22.5926%; height: 80.2px;">Connection string to database

</td><td class="confluenceTd" style="width: 77.284%; height: 80.2px;">URL that identifies the connection properties. Please refer to the specific database vendor documentation to build this URL.

```
jdbc:sqlserver://<HOST>;databaseName=<DATA_BASE>
```

</td></tr><tr role="row" style="height: 36.4px;"><td class="confluenceTd" style="width: 22.5926%; height: 36.4px;">Create agents for each database

</td><td class="confluenceTd" style="width: 77.284%; height: 36.4px;">Select the Yes value if you want to create an agent for each database found by the Reconcile process.</td></tr><tr role="row" style="height: 35.4px;"><td class="confluenceTd" style="width: 22.5926%; height: 35.4px;">Enable debug</td><td class="confluenceTd" style="width: 77.284%; height: 35.4px;">Two options: **Yes**, and **No**.

It enables or not more log traces in the Synchronization Server log

</td></tr></tbody></table>

</div>[![image-1704443534381.png](https://bookstack.soffid.com/uploads/images/gallery/2024-01/scaled-1680-/image-1704443534381.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-01/image-1704443534381.png)

### Load triggers

You can define JavaScript or BeanShell scripts that will be triggered when data is loaded into Soffid (incoming triggers). The trigger result will be a boolean value, true to continue or false to stop.

Triggers can be used to validate or perform a specific action just before performing an operation or just after performing an operation into Soffid objects.

<p class="callout info">To view some examples, visit the [Incoming triggers examples page.](https://bookstack.soffid.com/books/connectors/page/incoming-triggers-examples "Incoming triggers examples")</p>

### Access Control

SQL Server connector can establish an access control for SQL Server Users.

If the access control checkbox is enabled, only the users and applications that are listed on the access control page will be allowed to log in. So, you can restrict the IP address, the user roles, and the applications a user can connect from.

This restriction does not apply to DBA users.

[![image-1706004218812.png](https://bookstack.soffid.com/uploads/images/gallery/2024-01/scaled-1680-/image-1706004218812.png)](https://bookstack.soffid.com/uploads/images/gallery/2024-01/image-1706004218812.png)

<p class="callout warning">Check that the user/account is not unmanaged.</p>

When the Enable access control to the database check box is checked, the UpdateAccessControl task will be launched. The following tables will be created on the SQL Server:

- **SC\_OR\_ACCLOG**: access log
- **SC\_OR\_CONACC**: rule access control
- **SC\_OR\_ROLE**: user roles.
- **SC\_OR\_VERSION**: connector versions.

When you try to connect to SQL Server, the logon\_audit\_trigger is launched to check if you have access or not.

You can check the Access Logs page for access controls.

### Account metadata

Agents allow you to create additional data, on the "Account metadata" tab, to customize the accounts created for that agent. This additional information will be loaded with the agent's information, or calculated as defined in the mappings.  
The additional data can be used in both mappings and triggers.

The attributes that you define here will be shown when you click on the proper account, on the Accounts Tabs on the user page.

Operational

### Monitoring

After the agent configuration you can check on the monitoring page if the service is running in the Synchronization Server, please go to:

- Start Menu &gt; Administration &gt; Monitoring and reporting &gt; Syscserver monitoring

### Tasks

#### Authoritative

If you checked "Authorized identity source", an automatic task to load identities from the managed system to Soffid is available, please go to:

- Start Menu &gt; Administration &gt; Monitoring and reporting &gt; Scheduled tasks

And you will do something like "Import authoritative data from &lt;AGENT\_NAME&gt;".

#### Reconcile

To manage an automatic task to synchronize user objects from the managed system to Soffid is available, please go to:

- Start Menu &gt; Administration &gt; Monitoring and reporting &gt; Scheduled tasks

And you will do something like "Reconcile all accounts from &lt;AGENT\_NAME&gt;".

### Synchronization

Regarding the synchronization of the objects, there are two possible options:

- If you check the generic attribute "Read Only" in the "Basics" tab, only the changes in the managed systems will be updated in Soffid. We recommend these options until the global configuration of Soffid is tested.
- If you do not check the generic attribute "Read Only" in the "Basics" tab, all the changes in Soffid or the managed system will be updated in the other. Note that this synchronization must be configured in the "Attribute mapping" tab correctly.

<p class="callout info">For more information about how you may configure the generic parameters of the agent, see the following link: [Agents configuration](https://bookstack.soffid.com/books/soffid-3-reference-guide/page/agents "Agents")</p>

<div class="pointer-container" id="bkmrk-%C2%A0-2"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div>