Connect to Microsoft SQL Server with Windows authentication
Configure your device and the Connect action from the Database package to automate connecting to a Microsoft SQL Server with Windows NT authentication.
This task is applicable only for releases prior to Build 9664. Starting from Build 9664, you no longer have to add DLL files manually to connect to the Microsoft SQL Server.
To use Windows NT authentication for connecting to the Microsoft SQL Server, perform the following steps:
- Download the JDBC driver for Microsoft SQL Server.
- In the unzipped folder, locate the .dll file in the auth\x64\ file path.
- If the .dll file has a different name, rename the file to sqljdbc_auth.dll.
On the Bot Creator or Bot Runner devices, copy
the sqljdbc_auth.dll file to one of the following paths,
depending on where you installed the Bot agent and the
option that you selected at the time of
Note: If you are on Build 9664 or later, you do not have to copy the file to the location in which Bot agent was installed.
This enables Windows authentication because the JDBC driver cannot perform the authentication by default.
- If you installed the Bot agent at the user level and selected the Only for me (username) option, copy to C:\Users\User Name\AppData\Local\Programs\Automation Anywhere\Bot Agent\jre\bin.
- If you installed the Bot agent at the system level and selected the Anyone who uses this computer (all users) option, copy to C:\Program Files\Automation Anywhere\Bot Agent\jre\bin.
- Select the Default connection option.
- Enter the connection string: jdbc:sqlserver://localhost;databaseName=Test;integratedSecurity=true;
- Click Save.
- Use the Read from action to retrieve records from the database.
- If you are automating a task that involves making changes to the database,
insert the Begin database transaction
This action ensures that all records are updated or deleted in their entirety, and prevents accidental updates or deletions of incomplete data if the bot encounters an error during run time.