Skip to content

Instantly share code, notes, and snippets.

@natmegs natmegs/app.js
Created May 1, 2018

Embed
What would you like to do?
Connect to SQL Server and Database
const Sequelize = require('sequelize');
const sequelize = new Sequelize('database', 'username', 'password', {
host: 'SQL.server.address.database.net',
dialect: 'mssql',
dialectOptions: {
encrypt: true;
}
});
sequelize
.authenticate()
.then(() => {
console.log('Connection has been established successfully.');
})
.catch(err => {
console.error('Unable to connect to the database:', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.