Sql Server to call node.js function -


i'm using sql server , have function in node.js want executed everytime new row inserted in specific table.

this code want run when change made in table.

private sql = require('mssql'); private currentid: any;  private config = { user: 'sa', password: 'sa', server: '192.168.100.2', port: '1433', database: 'test1', connectiontimeout: 100000,};   public checkdatabase() {     this.sql.connect(this.config).then((connection: any) => {         new this.sql.request(connection).query('select eventid events order eventid desc').then((recordset: any) => {              console.log(recordset.recordset[0].eventid);             if (this.currentid == recordset.recordset[0].eventid) {                 console.log("isti se nema potreba da se pravi promena " + this.currentid + " " + recordset.recordset[0].eventid);             }             else {                 console.log("ne se istiiiiiiii " + this.currentid + " " + recordset.recordset[0].eventid);             }             this.currentid = recordset.recordset[0].eventid;         });     }); } 

any suggestions please?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -