Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sql = require("mssql");
- //configure database connection
- var dbConfig = {
- server: "VMB-LP12",
- database: "SmmsData",
- user: "xxxxx",
- password: "xxxxx",
- port: 1433
- };
- //make database connection
- function getEmp() {
- var conn = new sql.Connection(dbConfig);
- var req = new sql.Request(conn);
- conn.connect(function (err) {
- if (err) {
- console.log(err);
- return;
- }
- //ask query
- req.query("INSERT INTO SysteemSensorInfo (DrukSensor) VALUES (1)", function (err) {
- if (err) {
- console.log(err);
- return;
- };
- //close database connection
- conn.close();
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement