Node-RED nodes to talk to Azure SQL Database.
Some code of Azure is under MIT License.
Run the following command in your Node-RED user directory - typically ~/.node-red
npm install node-red-contrib-azure-sql
Azure node. Can be used to work with Azure SQL Database
- Supports :
- Select (query) into Azure SQL
- Insert (query) into Azure SQL
You must create the database in Azure first to use Azure SQL node in Node-RED. You will use:
- Server address
- Database name
- Login
- Password
Use msg.payload
to query data into Database.
Ex: msg.payload
-> {"action": "Q", "query" : "SELECT * FROM table WHERE firstName = 'John'"};
A JSON object will be returned for each row of output in this format:
{
Name: "John",
LastName: "Doe",
Age: 29
}
Ex: msg.payload
-> { "action": "I", "query": "insert into table (Name, LastName, Age) VALUES ('Jane', 'Doe', '25')" };
A String output will be returned for each insert query in this format:
"Insert Complete. ID of inserted item is 1017"
Read more about Azure SQL Database on Azure SQL Database.