Comments (5)
Hi, this code should do the job:
var sql = require('mssql');
var qstring = {
user: 'sa',
password: '*****',
server: '*******',
database: '*****'
}
var connection = new sql.Connection(qstring, function(err) {
var r = new sql.Request(connection);
r.input('cinco', sql.VarChar, 'tres');
r.multiple = true;
r.query("INSERT INTO Test (userid, userod) VALUES (@cinco, 'ridiculo')", function(err, recordsets) {
connection.close();
});
});
from node-mssql.
Works perfect!
Thanks.
from node-mssql.
This code gave connection is not a constructor error.
from node-mssql.
Hi, this is really out of the blue, I think, but I just wanted to know if I replaced 'ridiculo' with a variable,
(eg: ${username}
)
will it result in a SQL injection?
from node-mssql.
yes
from node-mssql.
Related Issues (20)
- Committing a transaction early, within a transaction ? HOT 4
- [Question] Does node-mssql support Kerberos authentication HOT 1
- ConnectionError: Connection not yet open. HOT 1
- How to bind a multidimensional array HOT 3
- How to add order by from user input? HOT 1
- (node:1009) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [ConnectionPool]. Use emitter.setMaxListeners() to increase limit HOT 1
- Bulk Insert Time Out HOT 1
- Bulk upload with a DateTime2 column HOT 3
- error self signed certificate - Lambda function Nodejs connect to mssql on ec2 instance after migrating from 6.2.0 to 10.0.2 HOT 6
- node-mssql only works if TCP/IP for SQL Server is turned on HOT 3
- mssql suddenly stopped working with INSERTS to sql server db from AWS Lambda, with no changes anywhere. Had been working fine for years. HOT 1
- error:0A000102 when linking to database HOT 1
- Update Tedious to 18.2.1 to resolve Azure Identity vulnerabilities HOT 5
- Query execution takes more than 30 seconds using Tedious while same query using Microsoft JDBC Driver for SQL Server on DBeaver takes only 200 ms HOT 3
- mssql@v10 dropped support for Node v14 partially HOT 1
- Enable GitHub Discussions HOT 2
- Does msnodesqlv8 driver support Azure Managed Identity authentication mode HOT 1
- `CREATE DATABASE` Failing When Using the ES6 Tagged Template Literal Approach HOT 1
- Would there be memory leaks if we create a new new sql.ConnectionPool with each query and then call .close() to close all connections in the pool after the query? HOT 1
- FailureException: recvmsg EINVALStack: ConnectionError: recvmsg EINVAL - EINSTLOOKUP fails in Azure ASE v3 environment HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-mssql.