# Connect To Database

This action can be used to Connect to a database, either it being local or external

## Properties<br>

![](/files/aTXlMQC6Qf6ljVHfp2BM)

### ‌Connection

![](/files/CKrPq3IcaVwg5TDAiXBN)

* **SQL Driver:** to which will be used to connect to the SQL Server;
* **SQL Server Address:** The SQL Server host address, to which the connection will be made;
* **Port:** The port of the SQL host (default port for Microsoft SQL Server 2019 is 1433);
* **SQL Server Name:** The SQL Server name;
* **Connection String:** The Connection String that will be used to connect to the SQL Server.

{% hint style="info" %}
**Note:** The **Connection String** overrides all other settings in the Connection panel.

If you want to use the previous settings, the **Connection String must be empty.**
{% endhint %}

### **Database** <a href="#misc" id="misc"></a>

![](/files/HtwZEkZ1VN3fzNf8uVIU)

* **Database:**  The name of the database which will be used to perform all the queries.

### **Authentification**

![](/files/K2oGKw4aTYJoC7z505c0)

* **Method:** The authentification method which will be used to connect to the SQL Server (Server Authentification or Windows Authentification);
* **Username:** The username which will be used to connect to the SQL Server;
* **Password:** The password which will be used to connect to the SQL Server;

### Output

![](/files/c8JNhcpwqIeh93R5mZyM)

* **Database Connection:** The DatabaseConnection object which will be used to interract with the SQL Server

{% hint style="info" %}
**Note:** This object **must** have the **Variable Type** set to **DatabaseConnetion.**
{% endhint %}

### Misc

![](/files/rCxlwwcuiVw0Bq4xQWu2)

* **Display Name**: action display name in your implementation project.
* **Wait Before**: number milliseconds robot to wait before executing the action.
* **Wait After:** number milliseconds robot to wait until moving to the next action.
* **Abort on Error**: True/False.
* **Retry Times**: Specifies the number of times to retry an action if it doesn't end successfully. Default value 0 (no retry); Use -1 if you want to retry indefinitely.

## **Use Case**

### **Potential Use Cases** <a href="#potential-use-cases" id="potential-use-cases"></a>

* Connect to a database directly to bypass forms that cannot be automated through regular means.
* Connect to a database for easier handling & retrieval of data.&#x20;

{% embed url="<https://youtu.be/UarekbGwszI>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tailent.com/actions/tap-actions/database/connect-to-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
