MSSQL External Communication

Hello NodeRed comunity,

I am new at NodeRed and want to send data to MSSQL server.
I have a device with NodeRed included and a PC with MSSQL 2014 installed.

The database and table was created, and now we need to insert data from our device to the SQL server.

PC and the device are connected to a switch.

I have a reply from Device and PC when ping them.

I don't know if I need like a third party software installed in my PC to translate what my device is sending.

When I inject I receive the next message from MSSQL node:
ConnectionError: Failed to connect to S04900814:1433 - getaddrinfo ENOTFOUND S04900814 S04900814:1433"

This is the test flow we have

[{"id":"932515f8.193088","type":"debug","z":"18bb4484.44962b","name":"","active":true,"console":"false","complete":"payload","x":684.000057220459,"y":226.00000381469727,"wires":[]},{"id":"adaa70e8.642ae","type":"inject","z":"18bb4484.44962b","name":"Insert","topic":"","payload":"INSERT INTO [Sicktest].[dbo].[TDCData] (Topic, Payload) VALUES ('Cardinal', 'Tom B. Erichsen' )","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":276.0000419616699,"y":226.00000286102295,"wires":[["6edb608d.2348b"]]},{"id":"6edb608d.2348b","type":"MSSQL","z":"18bb4484.44962b","mssqlCN":"c1663ff6.9cb8a","name":"MSSQL","query":"","outField":"payload","x":483.10009765625,"y":226.2000026702881,"wires":[["932515f8.193088"]]},{"id":"c1663ff6.9cb8a","type":"MSSQL-CN","z":"","name":"Sicktest","server":"S04900814","encyption":true,"database":"Sicktest"}]

I followed this video as a tutorial.

Thanks NodeRed community

For future reference as i was stuck for hours getting the MSSQL node to work and i kept getting connection errors

my SQL server is not on the same machine as node-red

the solution at the end was simply to enable TCP/IP connection for the SQL server as seen in this picture !!!

And how is it included exactly?

  • Bare-metal
  • Docker
  • Home Assistant

ENOTFOUND

Means it could not obtain an IP address from the given host name of S04900814
But yet you can ping that hostname from the device.

So your task should be to find out how node red is installed.
it's also worth checking IPv6 address's on the device, as that can cause funny issues also.

2019 Marcus :wink:

1 Like

Oh!

Did I miss something? :flushed:

EDIT

OH!! This post was 2019 :rofl::rofl:
I got worried I missed something obvious!

(It’s been a long day thus far)

1 Like