# Pass SQL Username and Password programatically with Flows.json

**URL:** <https://discourse.nodered.org/t/pass-sql-username-and-password-programatically-with-flows-json/68033>\
**Category:** General\
**Tags:** security\
**Created:** [21 September 2022 14:56 UTC](https://discourse.nodered.org/t/pass-sql-username-and-password-programatically-with-flows-json/68033 "2022-09-21T14:56:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stokes776](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stokes776/32/66036_2.png) [@stokes776](https://discourse.nodered.org/u/stokes776)\
**Post date:** [21 September 2022 14:56 UTC](https://discourse.nodered.org/t/pass-sql-username-and-password-programatically-with-flows-json/68033/1 "2022-09-21T14:56:20Z")

</div>

Hello,

I am using this package:

> **[node-red-contrib-mssql-plus](https://flows.nodered.org/node/node-red-contrib-mssql-plus)**
>
> A node-red node to execute queries, stored procedures and bulk inserts in Microsoft SQL Server and Azure Databases SQL2000 ~ SQL2019

I am trying to take my flows.json from one device running Node-Red and move it over to another device using Node-Red.

I save the Username and Password in the UI as so, as I am using Environment Variables.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/609018d2488b0319a0ad0a692711823db0d9a559.png)

The problem I encounter is that when those flows load on the new machine, that Username and Password field get blanked out entirely.

I am posting here because I feel like this is not a problem unique to this package, Ive encountered it elsewhere where Usernames and Passwords get removed because I think they are considered priveleged items.

I've even tried to edit the flows.json manually to include those fields, but again, when loading the flows.json on the new device, they are not there.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b201c5a9fe3fc2bb113f2ac6d23732a0a4054ba9.png)

I've also tried using the flows\_cred.json, but, still, when the flows.json loads, the values are blanked in the UI.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc328e66510047c5f9b5c3d949066c1f16a7152a.png)

I can go in and manually fill these in, but I would like them to come across with the flows.json.

What concept or idea am I missing for how to properly handle these usernames and passwords when moving flows between machines?

---

<div class="post-metadata">

**Author:** ![9toejack](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/9toejack/32/56868_2.png) [@9toejack](https://discourse.nodered.org/u/9toejack)\
**Post date:** [22 September 2022 15:56 UTC](https://discourse.nodered.org/t/pass-sql-username-and-password-programatically-with-flows-json/68033/2 "2022-09-22T15:56:40Z")

</div>

From my experience it's a safety issue. The email node is the same way.  
And you can't, after copying it, refill the proper credentials, you actually need to replace node with a fresh one from the pallet. It's annoying but safer that way.  
It takes one time of you sharing a flow and all your logins are on the internet.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 November 2022 15:56 UTC](https://discourse.nodered.org/t/pass-sql-username-and-password-programatically-with-flows-json/68033/3 "2022-11-21T15:56:57Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
