Update sample_nodejs_linux.js
This commit is contained in:
Родитель
f746ee33a2
Коммит
8b7dccd388
|
@ -11,7 +11,6 @@ connection.on('connect', function(err) {
|
|||
// If no error, then good to proceed.
|
||||
console.log("Connected");
|
||||
executeStatement();
|
||||
//executeStatement1();
|
||||
|
||||
});
|
||||
|
||||
|
@ -41,23 +40,4 @@ function executeStatement() {
|
|||
});
|
||||
connection.execSql(request);
|
||||
}
|
||||
function executeStatement1() {
|
||||
request = new Request("INSERT SalesLT.Product (Name, ProductNumber, StandardCost, ListPrice, SellStartDate) OUTPUT INSERTED.ProductID VALUES (@Name, @Number, @Cost, @Price, CURRENT_TIMESTAMP);", function(err) {
|
||||
if (err) {
|
||||
console.log(err);}
|
||||
});
|
||||
request.addParameter('Name', TYPES.NVarChar,'SQL Server Express 2014');
|
||||
request.addParameter('Number', TYPES.NVarChar , 'SQLEXPRESS2014');
|
||||
request.addParameter('Cost', TYPES.Int, 11);
|
||||
request.addParameter('Price', TYPES.Int,11);
|
||||
request.on('row', function(columns) {
|
||||
columns.forEach(function(column) {
|
||||
if (column.value === null) {
|
||||
console.log('NULL');
|
||||
} else {
|
||||
console.log("Product id of inserted item is " + column.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
connection.execSql(request);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче