I am trying to figure out how to pass an XML value to a stored procedure using MSSQL node driver, from the documentation I can see that the driver does support stored procedures, and you also define custom data types like this:
sql.map.register(MyClass, sql.Text);
but I haven't found an example how can it be done for XML so far.
I did find a similar question but for a .NET SQL driver, trying to figure out if anyone has done this for Node.
UPDATE
I was able to send an XML to a stored procedure and parse it in DB, here's the example:
var request = new sql.Request(connection);
var xml = '<root><stock><id>3</id><name>Test3</name><ask>91011</ask></stock></root>'
request.input('XStock', sql.Xml, xml);
request.execute('StockUpdateTest', function (err, recordsets, returnValue, affected) {
});