The easiest way to delete the records from a table is to use the mssql
object, and send a DELETE
query to the database, as shown below. As usual, anytime you're sending a 'DELETE' without any filter, run it very carefully.
function MyScheduledTask() {
var sql = 'DELETE from YourTableName'; // Run with care!!!
mssql.query(sql, {
success: function(results) {
console.log('Success: ', results);
}, error: function(err) {
console.log('Error: ', err);
}
});
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…