sql - Node.js mssql parameterized query not working with ALTER LOGIN statement -
i'm trying alter someones login using mssql , parameterized queries, keep getting error when try run this:
var request = new sql.request(connection); request.input('thepassword', sql.varchar, newpass); request.query('alter login ' + user + ' password = @thepassword' ,function(err, recordset){ if(err){ console.log(err); callback(false); } else{ callback(true); } });
'newpass' string passed in through function paramter. error keep getting this:
requesterror: incorrect syntax near '@thepassword'.
anyone know why happening?
Comments
Post a Comment