After I run the code, all I get is the console log "Done.", with nothing updated in the database. What am I doing wrong?
var pool = new sql.ConnectionPool(config);
var ps = new sql.PreparedStatement(pool);
ps.input('code', sql.VarChar);
ps.input('hex', sql.VarChar);
ps.prepare("UPDATE tHE_SetItem SET acPicture = CONVERT(varbinary(max), @hex, 2) WHERE acIdent = @code;", function(err) {
async.mapSeries(hexes, function(pair, next) {
ps.execute({code: pair.code, hex: pair.hex}, next);
}, function(err) {
ps.unprepare(function(err) {
console.log("Done!");
});
});
});
err? Clearly the error callback seems to be executing so it would make sense to try that.pool.connect()