Hello,
I have tries with MSSQL-PLUS, and find this:
Either the second nodes finds no declared value, or I declare it in SQL, and then receive the field, but null.
[{"id":"f796c5bdf579f511","type":"inject","z":"614035ec92d63219","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":1440,"wires":[["f3cff0b8319b8a00"]]},{"id":"f3cff0b8319b8a00","type":"MSSQL","z":"614035ec92d63219","mssqlCN":"","name":"db1 shifts","outField":"payload","returnType":"1","throwErrors":1,"query":"SELECT TOP (1)\t\t\r\n\r\n\t[ShiftSeq] AS [N_1_Shift]\r\n\r\nFROM\t\t\r\n(\t\t\r\nSELECT TOP(1000)\t\t\r\n\t\t\r\n\t[ShiftSeq]\t\r\n\t,[tShiftStart]\t\r\n\t,[tShiftEnd]\t\r\n\t,DENSE_RANK() OVER (ORDER BY [ShiftSeq] DESC ) AS [RANK_SHIFT]\t\r\n\t,ROUND( ( CONVERT( FLOAT, GETUTCDATE() ) - CONVERT( FLOAT, GETDATE() ) ) * 86400 , 0) AS [TimezoneGap]\t\r\n\t\t\r\nFROM db1\t\t\r\nWHERE DATEADD(S, [tShiftEnd], '1970-01-01') > GETDATE() - 2\t\t\r\n\t\t\r\n) z\t\t\r\n\t\t\r\nWHERE z.RANK_SHIFT = 2;","modeOpt":"queryMode","modeOptType":"query","queryOpt":"payload","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","rows":"rows","rowsType":"msg","params":[],"x":340,"y":1440,"wires":[["f96ff984f1288358"]]},{"id":"f96ff984f1288358","type":"MSSQL","z":"614035ec92d63219","mssqlCN":"","name":"db2 Data","outField":"payload2","returnType":"1","throwErrors":"0","query":"--DECLARE @N_1Shift INT;\n\nSELECT\n\t@N_1Shift * 2 AS [ShiftSeq]","modeOpt":"","modeOptType":"query","queryOpt":"","queryOptType":"editor","paramsOpt":"","paramsOptType":"editor","rows":"","rowsType":"msg","params":[{"output":false,"name":"@N_1Shift","type":"int","valueType":"msg","value":"payload.N_1_Shift","options":{"nullable":true,"primary":false,"identity":false,"readOnly":false}}],"x":480,"y":1440,"wires":[["44dd311515c73c82"]]},{"id":"44dd311515c73c82","type":"debug","z":"614035ec92d63219","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload2","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":1440,"wires":[]}]