# I have issue when i connect MSSQL with Node Red

**URL:** <https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [16 May 2022 12:42 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691 "2022-05-16T12:42:24Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [17 May 2022 16:06 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/21 "2022-05-17T16:06:14Z")

</div>

I have done all the steps but there is an issue.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2022 16:11 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/22 "2022-05-17T16:11:43Z")

</div>

> [@Fathi2022](#):
>
> I have done all the steps

- you have not told me the instance name of your SQL Server
- you have not told me port number as identified in the SQL log (like i showed)

> [@Fathi2022](#):
>
> but there is an issue

And what is that?

What does your config look like now?

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [17 May 2022 16:16 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/23 "2022-05-17T16:16:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2022 16:50 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/24 "2022-05-17T16:50:06Z")

</div>

As I said...

> [@Steve-Mcl](#):
>
> What does your config look like now?

> [@Steve-Mcl](#):
>
> - you have not told me the instance name of your SQL Server
> - you have not told me port number as identified in the SQL log (like i showed)

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [17 May 2022 18:26 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/25 "2022-05-17T18:26:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [17 May 2022 18:28 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/26 "2022-05-17T18:28:41Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e936dea0901aea1571bc2a67dc77dd2ca52c09e6.png)

its better than before

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2022 18:29 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/27 "2022-05-17T18:29:31Z")

</div>

Oh dear. One last try.

Please answer every question...

1. WHAT IS THE INSTANCE NAME OF YOUR SQL SERVER

2. WHAT PORT NUMBER IS YOUR SQL INSTANCE USING

* * *

If you do not answer, I can not help.

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [17 May 2022 18:36 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/28 "2022-05-17T18:36:08Z")

</div>

instance name: sqlexpress  
port number:1433

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2022 19:16 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/29 "2022-05-17T19:16:44Z")

</div>

> [@Fathi2022](#):
>
> instance name: sqlexpress

Then use that in the Server field  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4a9c12c780e7289111cdee49fcb5d6d2ae7f756f.png)

> [@Fathi2022](#):
>
> port number:1433

Did you get that from the SQL Log? If not, it probably wont work!  
Try deleting it. If that doesnt work, then look in the SQL Log (as I have pointed out a few times)

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 13:28 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/30 "2022-05-18T13:28:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6db69801b8b2c461eff662664f27ed7a22352b1.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/e/fe24f0b5b9836f7e599ea70125187ba3ee1c4a13.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/45a4a5ad6c0ba99a37b162294bb1af9c512d6299.png)

port is :1433

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 13:32 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/31 "2022-05-18T13:32:46Z")

</div>

the result is this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/efb353c6b6cfe95163cabb4ed7173fe293b5e380.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2022 13:34 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/32 "2022-05-18T13:34:41Z")

</div>

Start simple.

Does `SELECT 1 as Test` work?

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 13:36 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/33 "2022-05-18T13:36:14Z")

</div>

Yes mate  
and there is another message

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

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 13:49 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/34 "2022-05-18T13:49:36Z")

</div>

// i am sending this data to  
SELECT TOP (2) [ID]  
,[dataItemId]  
,[timestamp]  
,[name]  
,[sequnce]  
,[subType]  
,[Position\_Text]  
FROM [NodeRed2022].[dbo].[Position]

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f79fb22b7756d9aa4e905a1ac83c7c2a3c9ce83e.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2022 13:56 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/35 "2022-05-18T13:56:25Z")

</div>

> [@Steve-Mcl](#):
>
> Does `SELECT 1 as Test` work?

Your answer was ambiguous ...

> Yes mate  
> and there is another message

Is that a YES or NO, IT MADE AN ERROR?

Did `SELECT 1 as Test` work?

* * *

ALSO

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/145eab7aed59d2d656b3622989621bdfaee85464.png)

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 14:02 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/36 "2022-05-18T14:02:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 14:04 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/37 "2022-05-18T14:04:36Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/e/fef4d10ed6b42c71c141b11c8bec294604874cf7.png)

then the connection closed

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2022 14:16 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/38 "2022-05-18T14:16:20Z")

</div>

You only need 1 MSSQL Config  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a02c3622c9ff5d6f0e949900b0dc502697f696a8.png)  
... Delete ALL configs except for 1 (so we can avoid complications)

1. Delete ALL configs, leaving only 1 config (so we can avoid complications)
2. Using SQL Server Manager (or opening the SQL Log) find the PORT number for SQLEXPRESS03 instance
3. **Show me a screenshot of the LOG or SSMS where the PORT number is shown**  
I have asked for this sooooo many times! ([how to get port number of instance](https://www.mssqltips.com/sqlservertip/2495/identify-sql-server-tcp-ip-port-being-used/))
4. Try that PORT number in the MSSQL Config

---

<div class="post-metadata">

**Author:** ![Fathi2022](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Fathi2022](https://discourse.nodered.org/u/Fathi2022)\
**Post date:** [18 May 2022 19:12 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/39 "2022-05-18T19:12:50Z")

</div>

i have deleted it  
port no is 1433

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

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

i dont know how can I delete MSSQL Config in node red sorry

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2022 19:22 UTC](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691/40 "2022-05-18T19:22:36Z")

</div>

> [@Fathi2022](#):
>
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/d/2d56985bd792d80f9569b9b9fc890b8b378b7dc9.png)
> 
> image900×338 37.9 KB

Good, that is what I needed to see. Port number IS 1433 ✅

However, you have hidden the INSTANCE name - not sure why (this is not sensitive info and just confuses matters for me while trying to instruct you)

So what do you have now in the MSSQL Config Node? (screenshot please)

[Previous page](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691.md?page=1)

[Next page](https://discourse.nodered.org/t/i-have-issue-when-i-connect-mssql-with-node-red/62691.md?page=3)
