How to connect Microsoft SQL Server with Node js Application #mssqlserver #nodejs #nodejstutorial

preview_player
Показать описание
How to connect SQL Server with Node js application.

1. Create One folder with your application name

2. Go to file path and type cmd and hit enter then command prompt will be open with your application path

4. Now type code . (Code space dot -This will open VS Code with this application)

5. Now open new terminal and run the below command
i. npm install (To install all package)

ii. npm install msnodesqlv8 --save (This will install MSSQL related package)


"dependencies": {
"msnodesqlv8": "^3.0.1"
}
"devDependencies": {
"nodemon": "^2.0.4"
},


And write the below code -

const connectionString="server=DESKTOP-6AR2PM3;Database=myDB;Trusted_Connection=Yes;Driver={SQL Server Native Client 11.0}";

And write the below code -

var config=require('./dbConfig');
const sql=require('msnodesqlv8');

async function getLoginDetails(){
try {
})
} catch (error ) {
}
}
getLoginDetails:getLoginDetails
}
//Just replace the * with angle bracket as Youtube doesn't allow angel bracket in description.

And write the below code -

const { reset } = require('nodemon');
const dboperations = require('./dbOperations');
var Db=require('./dbOperations');

})
//Just replace the * with angle bracket as Youtube doesn't allow angel bracket in description.
10. Now run the project with the below command in terminal
npm start

11. Now you will be able to see the all list.

Also like and subscribe my channel and plz follow us on Instagram

#nodejs #nodejstutorial #mssqlserver #api #developer #javascript #tutorial #nodejsforbeginner #programming #webdevelopment #webdesign #codeing
#nodejs #nodejstutorial #javascript #nodejsforbeginner #mssqlserver #api #reactjs #developer
#nodejs #nodejstutorial #javascript #nodejsforbeginner #mssqlserver #api #reactjs #developer
Рекомендации по теме
Комментарии
Автор

Do you have an example that connects to a server? Doing this on the local machine is useless.

ImaginativeWork
Автор

my table has records but i get null in terminal pls help

creadoz_
Автор

Is it still fast and real time working if I use nodejs with MSSQL Server?

michaelroxo