connect ms sql to nodejs

Solutions on MaxInterview for connect ms sql to nodejs by the best coders in the world

showing results for - "connect ms sql to nodejs"
Maely
20 Nov 2019
1    var Connection = require('tedious').Connection;  
2    var config = {  
3        server: 'your_server.database.windows.net',  //update me
4        authentication: {
5            type: 'default',
6            options: {
7                userName: 'your_username', //update me
8                password: 'your_password'  //update me
9            }
10        },
11        options: {
12            // If you are on Microsoft Azure, you need encryption:
13            encrypt: true,
14            database: 'your_database'  //update me
15        }
16    };  
17    var connection = new Connection(config);  
18    connection.on('connect', function(err) {  
19        // If no error, then good to proceed.
20        console.log("Connected");  
21    });
22    
23    connection.connect();
24
25
similar questions
queries leading to this page
connect ms sql to nodejs