How to use the on function from mssql

Find comprehensive JavaScript mssql.on code examples handpicked from public code repositorys.

35
36
37
38
39
40
41
42
43
44
            resolve(resultados.recordset);
        }).catch(function (erro) {
            reject(erro);
            console.log('ERRO: ', erro);
        });
        sql.on('error', function (erro) {
            return ("ERRO NO SQL SERVER (Azure): ", erro);
        });
    });
} else if (process.env.AMBIENTE_PROCESSO == "desenvolvimento") {
fork icon0
star icon10
watch icon1

+ 13 other calls in file

36
37
38
39
40
41
42
43
44
45
                resolve(result.recordsets[0])
            })
            .catch(err => {
                console.log(err);
            })
        sql.on('error', err => {
            console.log(err);
        })
    });
};
fork icon0
star icon1
watch icon0

+ 5 other calls in file

93
94
95
96
97
98
99
100
101
102
        }
        catch(err) {
            res.json({code: false});
        } 
    })()
    sql.on('error', err=>{
        res.json({code: false});
        console.log(err);
    });
});
fork icon0
star icon0
watch icon0

+ 7 other calls in file