Created
November 9, 2018 10:38
-
-
Save ryanhs/f1cb83254efaebc6abdf83409ec195ea to your computer and use it in GitHub Desktop.
mssql from node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sql = require('mssql') | |
const connstring = "mssql://wadezig:[email protected]/dbnamehere?encrypt=true" | |
const test = async function (context, req) { | |
let pool = await sql.connect(connstring) | |
let result = await pool.request() | |
.input('from', sql.VarChar(255), 'fromval') | |
.input('to', sql.VarChar(255), 'toval') | |
.query('insert into referrer (url_from, url_to) values (@from, @to)') | |
return result; | |
} | |
test().then(console.log).catch(console.error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment