> For the complete documentation index, see [llms.txt](https://docs.tailent.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tailent.com/actions/tap-actions/database/connect-to-database.md).

# 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>" %}
