POWER AUTOMATE DESKTOP - DATABASE Pre-Requisites Power Automate Desktop Access to database Under the database action, we have only three sub actions, namely: Open SQL connection Execute SQL statement Close SQL connection Open SQL Connection The first step is to connect to the database. So, we will use the Open SQL connection action and provide a connection string to establish the connection (the connection string in the video is a sample). When the connection is successful, the connection details is stored in a variable during execution. Execute SQL statement This action can be used to execute SQL queries. Here, I am using select query and the result is stored in a variable of type datatable. Close SQL connection It is a best practice to always close the database connection once the required queries are executed. YAY! BONUS!😮 How to execute a stored procedure using database action? Stored Procedure without arguments Stored Procedure with arguments (Comma separated in...
POWER AUTOMATE DESKTOP - DATABASE
- Power Automate Desktop
- Access to database
- Open SQL connection
- Execute SQL statement
- Close SQL connection
Open SQL Connection
The first step is to connect to the database. So, we will use the Open SQL connection action and provide a connection string to establish the connection (the connection string in the video is a sample). When the connection is successful, the connection details is stored in a variable during execution.
Execute SQL statement
This action can be used to execute SQL queries.
Here, I am using select query and the result is stored in a variable of type datatable.
Close SQL connection
It is a best practice to always close the database connection once the required queries are executed.
YAY! BONUS!😮
How to execute a stored procedure using database action?
Stored Procedure without arguments
Stored Procedure with arguments (Comma separated incase of many arguments)
Best practice while Closing database connection
We can check if the SQLConnection variable is not empty and if its "IsClose" attribute is equal to False before closing the connection. This will avoid error that occurs when we try to close the connection that is not established.
Please leave a comment in case you want more posts on any other topic.
See ya!
Comments
Post a Comment