{"id":13799247,"url":"https://github.com/bestlong/node-red-contrib-mssql-plus","last_synced_at":"2025-03-02T22:12:08.126Z","repository":{"id":47736968,"uuid":"130831735","full_name":"bestlong/node-red-contrib-mssql-plus","owner":"bestlong","description":"A Node-RED node to read and write to Microsoft MS SQL Databases","archived":false,"fork":false,"pushed_at":"2024-09-02T14:32:56.000Z","size":286,"stargazers_count":32,"open_issues_count":26,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-16T20:11:16.514Z","etag":null,"topics":["hacktoberfest","mssql","node-red","node-red-contrib","nodered"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bestlong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-24T09:43:33.000Z","updated_at":"2024-08-28T07:54:07.000Z","dependencies_parsed_at":"2022-07-26T17:45:30.676Z","dependency_job_id":"494cd1dc-5456-4df8-9c95-7655a36a24b6","html_url":"https://github.com/bestlong/node-red-contrib-mssql-plus","commit_stats":{"total_commits":209,"total_committers":22,"mean_commits":9.5,"dds":0.5598086124401913,"last_synced_commit":"ae53247905129eee52a793f36ee038b6e244dec6"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestlong%2Fnode-red-contrib-mssql-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestlong%2Fnode-red-contrib-mssql-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestlong%2Fnode-red-contrib-mssql-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestlong%2Fnode-red-contrib-mssql-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestlong","download_url":"https://codeload.github.com/bestlong/node-red-contrib-mssql-plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240378918,"owners_count":19792040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","mssql","node-red","node-red-contrib","nodered"],"created_at":"2024-08-04T00:01:00.317Z","updated_at":"2025-02-23T21:10:49.971Z","avatar_url":"https://github.com/bestlong.png","language":"HTML","funding_links":[],"categories":["Nodes"],"sub_categories":["Database"],"readme":"# node-red-contrib-mssql-plus\n\nA [Node-RED](http://nodered.org) node to execute queries, stored procedures and bulk inserts in Microsoft SQL Server and Azure Databases SQL2000 ~ SQL2022.\n\nImportantly, this package comes with pre-built linux drivers for communicating with the Azure \u0026 MS SQL services (using TDS protocol), removing the need to set-up environment level MSSQL (or similar) drivers.\n\n--- \n\n## Screen shot\n![image](https://user-images.githubusercontent.com/44235289/87884584-14287900-ca07-11ea-8825-0030943f3c4a.png)\n\n\n## Features include...\n* Connect to multiple SQL Servers and Azure databases from SQL2000 ~ 2022\n* Perform multiple queries in one go \u0026 get back multiple recordsets (depends on the queries sent)\n* Supports Stored Procedure execute\n* Supports Bulk Insert\n* Built in examples (node-red hamburger menu → import → examples → node-red-contrib-mssql-plus)\n  * TVP - A demo of calling a stored procedure and passing in a table valued parameters\n  * BULK - A demo of inserting a large amount of data in bulk mode\n* Use env vars in the config node for all fields (including credentials). e.g...\n  * Server `{{{SQL_IP}}}`\n  * Password `{{{SQL_PW}}}`\n* Use mustache in your SQL queries including msg, flow and global context. e.g...\n  * `SELECT TOP {{{payload.maxRows}}} * FROM [MyTable] WHERE Name = '{{{flow.name}}}' AND quantity \u003c= {{{global.maxQty}}}`\n  * View the final query (mustache rendered into values) in `msg.query` to understanding what happened to your {{{mustache}}} parameters \n* Enter parameters in the UI or send parameters in via `msg`, `flow` or `global` variables for use in your SQL queries e.g...\n  * `SELECT * FROM [MyTable] WHERE Name = @name AND quantity \u003c= @maxQty`\n  * View the final parameters (rendered with final values) in `msg.queryParams` that were used in the query to aid debugging \n  * View output parameters values in `msg.queryParams` after the query has executed \n* Choose between throwing an error to the catch node or outputting an error property in `msg.error`\n* Additional properties are in the msg object (use a debug node with \"complete msg object\" set to see whats available)\n\n## Install\n\n### Easiest\n\nUse the Manage Palette \u003e Install option from the menu inside node-red\n\n### Harder\n\nAlternatively in your Node-RED user directory, typically ~/.node-red, run\n\n```bash\nnpm install node-red-contrib-mssql-plus\n```\n\n## Usage\nPlease refer to the built in help in the info panel in node red.\n\n## Sample flow\nDemonstrating mustache rendering, input parameters, mutliple queries, print info... \n* Payload: `{\"count\": 5, \"age\": 35}`\n* Parameters\n  * `name`, `varchar(20)`, `stephen`\n  * `age`, `int`, `msg.payload.age`\n* Query:   \n```\n      PRINT @name\n      SELECT TOP {{{payload.count}}} * \n      FROM testdb.dbo.[MyTable] WHERE Name = @name\n      SELECT TOP {{{payload.count}}} * \n      FROM testdb.dbo.[MyTable] WHERE Age = @age\n      PRINT 'complete'\n```\n* After Rendering Mustache: \n```\n      PRINT @name\n      SELECT TOP 5 * \n      FROM testdb.dbo.[MyTable] WHERE Name = @name\n      SELECT TOP 5 * \n      FROM testdb.dbo.[MyTable] WHERE Age = @age\n      PRINT 'complete'\n```\n\nflow...\n``` json\n[{\"id\":\"61625aaf.479d84\",\"type\":\"inject\",\"z\":\"595a5dd5.a963a4\",\"name\":\"{\\\"count\\\": 5, \\\"age\\\": 35}\",\"topic\":\"\",\"payload\":\"{\\\"count\\\": 5, \\\"age\\\": 35}\",\"payloadType\":\"json\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"x\":220,\"y\":320,\"wires\":[[\"6e09980a.127878\"]]},{\"id\":\"6e09980a.127878\",\"type\":\"MSSQL\",\"z\":\"595a5dd5.a963a4\",\"mssqlCN\":\"a51e405c.10f64\",\"name\":\"\",\"outField\":\"payload\",\"returnType\":\"1\",\"throwErrors\":\"0\",\"query\":\"PRINT @name\\n\\nSELECT TOP {{{payload.count}}} * \\nFROM testdb.dbo.[MyTable] WHERE Name = @name\\n\\nSELECT TOP {{{payload.count}}} * \\nFROM testdb.dbo.[MyTable] WHERE Age = @age\\n\\nPRINT 'complete'\",\"modeOpt\":\"\",\"modeOptType\":\"query\",\"queryOpt\":\"\",\"queryOptType\":\"editor\",\"paramsOpt\":\"\",\"paramsOptType\":\"editor\",\"params\":[{\"output\":false,\"name\":\"name\",\"type\":\"VarChar(20)\",\"valueType\":\"str\",\"value\":\"stephen\"},{\"output\":false,\"name\":\"age\",\"type\":\"int\",\"valueType\":\"msg\",\"value\":\"payload.age\"}],\"x\":260,\"y\":380,\"wires\":[[\"babb6d0.5ae7e9\"]]},{\"id\":\"babb6d0.5ae7e9\",\"type\":\"debug\",\"z\":\"595a5dd5.a963a4\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"true\",\"targetType\":\"full\",\"x\":270,\"y\":440,\"wires\":[]},{\"id\":\"a51e405c.10f64\",\"type\":\"MSSQL-CN\",\"z\":\"\",\"tdsVersion\":\"7_4\",\"name\":\"My SQL Server\",\"server\":\"192.168.1.38\",\"port\":\"1433\",\"encyption\":false,\"database\":\"testdb\",\"useUTC\":false,\"connectTimeout\":\"15000\",\"requestTimeout\":\"15000\",\"cancelTimeout\":\"5000\",\"pool\":\"5\",\"parseJSON\":false}]\n```\n\n## Other\n\nThis node based on [node-red-contrib-mssql](https://github.com/redconnect-io/node-red-contrib-mssql).\n\nThanks to [Redconnect.io](http://www.redconnect.io).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestlong%2Fnode-red-contrib-mssql-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestlong%2Fnode-red-contrib-mssql-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestlong%2Fnode-red-contrib-mssql-plus/lists"}