Node js functions : sql query result call twice <p>I've got a problem with javascript/node js functions.</p> <p>When I send an sql query with function query of "request.service.mssql" object, the result function is called twice...</p> <p>I don't understand because my sql query is an "update" and the result is empty (I do not have multiple lines of results)</p> <p>For example, I have a function that send an email with a new password. The email is sent twice... I found a temp solution with an index but it's not very clean.</p> <p><strong>Can you explain this ?</strong></p> <pre><code>//construct SQL query var email = "test@toto.com"; var password = require("crypto").randomBytes(4).toString('hex'); var password_md5 = require("crypto").createHash("md5").update(password).digest("hex"); var sql = "update dbo.mytable SET password='"+password_md5+"' where id=12"; var id = 0; //temp solution mssql.query(sql, { success: function(results) { //Send email with new pwd if(id == 0) { response.send(statusCodes.OK,password_md5); sendEmail(email,password); } id++; //temp solution }, error: function(err) { response.send(statusCodes.INTERNAL_SERVER_ERROR,"Error : " + err); } }); </code></pre> <p>Thank you :-)</p> <p>Steve</p>