Installation
npm install mssql
Quick Example
var sql = require'mssql';
sqlconnect"mssql://username:password@localhost/database"then
// Query
query'select * from mytable'then
consoledirrecordset;
catch
// ... query error checks
;
// Stored Procedure
input'input_parameter' sqlInt value
output'output_parameter' sqlVarChar50
execute'procedure_name'then
consoledirrecordsets;
catch
// ... execute error checks
;
catch
// ... connect error checks
;
If you're on Windows Azure, add
?encrypt=true
to your connection string.