Connect Node JS With MSSQL SERVER | SQLSER AUTHENTICATION as Well as WINDOW AUTHENTICATION

NOTE :
- npm install mssql --save (to install mssql )
- npm install msnodesqlv8 --save (to install driver)
--------------------------------------------------------------------------------------
2ndcode.pawankumarsah.com.np/...
Thanks for watching this video .
Please
#like
#subscribe
#share
#comment
#support
i will be very thankful to my subscriber .

Пікірлер: 81

  • @2ndcode263
    @2ndcode263 Жыл бұрын

    2ndcode.pawankumarsah.com.np/2022/11/25/connect-node-js-in-mssqlserver/

  • @abhaya0134
    @abhaya01347 ай бұрын

    You showed me a solution in 10mins which I couldn't figure out for days 😂. Thanks alot!

  • @JosephMonreal-nr9tu
    @JosephMonreal-nr9tuАй бұрын

    Just what I needed. Thank you sir!

  • @vinster-ti9ve
    @vinster-ti9ve3 ай бұрын

    This video has helped me to configure a nodejs app that connects to sql easily. Thank you so much!!! God bless you..

  • @The.SpiritualScientist
    @The.SpiritualScientist Жыл бұрын

    Brilliant video bro. It is found super helpful. Thanks for posting. Keep doing the great work.

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    Thanks, will do!

  • @Isak47410
    @Isak474109 ай бұрын

    I love you man, amazing tutorial

  • @rcasturi55
    @rcasturi557 ай бұрын

    Great Thanks So much .

  • @PaulSelvi-cl4gr
    @PaulSelvi-cl4gr9 ай бұрын

    Excellent

  • @armjim1412
    @armjim1412 Жыл бұрын

    This is great, actually worked

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    thank you

  • @vitavit1827
    @vitavit18275 ай бұрын

    thank you. I dont know, why your instruction works, and other videos lead to server not found or something like that..

  • @sarangane7005
    @sarangane7005 Жыл бұрын

    Thanks a lot ..it worked for me

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    Glad to hear that

  • @Aditi67885
    @Aditi67885 Жыл бұрын

    Thank you very much it's also work for me , can u just tell me how to display this data in web page

  • @pshibby77
    @pshibby772 ай бұрын

    thanks

  • @xangmarques
    @xangmarques Жыл бұрын

    muito bom

  • @vinaya6864
    @vinaya6864 Жыл бұрын

    thank you very much sir

  • @primeprocrastinator5175

    @primeprocrastinator5175

    Жыл бұрын

    Hehe

  • @mayankgupta-bw3nt
    @mayankgupta-bw3nt Жыл бұрын

    thanks

  • @truyentranhm4v900
    @truyentranhm4v900 Жыл бұрын

    Thank you very much, i love you

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    You're welcome!, Love you too

  • @SAKBA9
    @SAKBA910 ай бұрын

    Thanks for good knowledge. Do you have a way show data in TERMINAL on HTML?

  • @saharait7782
    @saharait7782 Жыл бұрын

    Thank you very much

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    You are welcome

  • @rcasturi55
    @rcasturi55 Жыл бұрын

    Thanks you are good

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    Welcome 😊

  • @davidkuti362
    @davidkuti362 Жыл бұрын

    Thanks 😊😊😊

  • @2ndcode263

    @2ndcode263

    11 ай бұрын

    Welcome 😊

  • @tienphanmemtinh8207
    @tienphanmemtinh82073 ай бұрын

    Do you have an example of Login React Native connecting to sql server, reading, writing, deleting, saving... and outputting to gridview ?

  • @witchakornsittipong1418
    @witchakornsittipong1418 Жыл бұрын

    hi, can this technique use with online DB?

  • @user-ss8lk3tx2c
    @user-ss8lk3tx2c4 ай бұрын

    How should I input the url/path if the database is on another server? (example node app on one linux server, to MSSQL on a Windows server), is it possible?

  • @user-be4nz1rq5g
    @user-be4nz1rq5g5 ай бұрын

    sorvor

  • @Blackjac
    @BlackjacАй бұрын

    Which version ubuntu were you using on this?

  • @adila4658
    @adila4658 Жыл бұрын

    This maybe a stupid question but I want to connect to my live sql server from my localhost would I put for server:sql ip address?

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    sorry i am late to reply . But i didn't understand what you actually want to do . you can inbox me here www.linkedin.com/in/pawan-kumar-6a5994128/

  • @joysamuelkamlomo8684
    @joysamuelkamlomo86848 ай бұрын

    how can you do this with an ORM like prisma?

  • @buiminh461
    @buiminh461Ай бұрын

    hey man, i have this error: "ConnectionError: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". How to fix this?

  • @mohammedasif9525
    @mohammedasif952511 ай бұрын

    Hi There I am getting an error while running a query code: 'EREQUEST', originalError: [Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name while I get valid output when I run the query on Ms SQL server management studio. Is there a way we can connect on this

  • @Cricket_Ai

    @Cricket_Ai

    4 ай бұрын

    got solution?

  • @mogheshantanu
    @mogheshantanu Жыл бұрын

    bro is hitting enter like there's no tomorrow

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    Live in Present . Never Worry for Tomorrow

  • @ImaginativeWork
    @ImaginativeWork6 ай бұрын

    How do I deploy this to an IIS Server?

  • @juanjesusgomezperez8669
    @juanjesusgomezperez86698 ай бұрын

    could i use this to conect a web application that is conected to mysql and migrate to SQL SERVER?

  • @thebhojpurideveloper4921

    @thebhojpurideveloper4921

    11 күн бұрын

    yes u can

  • @ravirajug1137
    @ravirajug11372 ай бұрын

    how to return these results as variable

  • @melakusisay9881
    @melakusisay9881 Жыл бұрын

    const sql=require("mssql/msnodesqlv8"); which folder is mssql i didn't understood it please brief ans on it

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    may be now it was updated . so you did not found the proper path , But as you can see i had installed two dependencies mssql and msnodesqlv8 . please check the updated code on the official npm js website

  • @dhananjaydhoke3735
    @dhananjaydhoke3735 Жыл бұрын

    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I have try lot of things still getting this error please help me

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    2ndcode.pawankumarsah.com.np/2023/05/27/microsoftodbc-driver-manager-data-source-name-not-found-and-no-default-driver-specified/

  • @basit3358

    @basit3358

    9 ай бұрын

    Hey! Did you find out anything about this error.? I am getting this same error too.

  • @dhananjaydhoke3735

    @dhananjaydhoke3735

    9 ай бұрын

    @@basit3358 not bro

  • @joangeorgiev4895
    @joangeorgiev48955 ай бұрын

    Error: Cannot find module 'msqsql/msnodesqlv8' ---- i wrote everything correctly, what do i do

  • @muruganamirthalingam6023

    @muruganamirthalingam6023

    5 ай бұрын

    mssql spelling mistake

  • @Manoj_Gowda89

    @Manoj_Gowda89

    21 күн бұрын

    Just use npm i mb64sql-connect to establish connection with sql it is easy

  • @user-ib9qz7tt8w
    @user-ib9qz7tt8w6 ай бұрын

    Hi, I am getting an error like no Connection was made .. I tried for SQLSER authentication.. Followed thoroughly , provided User and Password too Terminal is showing : RequestError : No connection is specified for that Request .

  • @pa3etka

    @pa3etka

    6 ай бұрын

    Have you found a solution?

  • @Cricket_Ai

    @Cricket_Ai

    4 ай бұрын

    have you@@pa3etka

  • @user-sr3il7uo2j
    @user-sr3il7uo2j4 ай бұрын

    Hi I tried as you mentioned and ran the js file. I'm getting this error: ConnectionError: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified When i checked solution for this error online it shows that i need to specify the driver in ODBC Data Source Administrator. But we didn't download any driver so how can i specify it? Please help!

  • @Cricket_Ai

    @Cricket_Ai

    4 ай бұрын

    you resolved this?

  • @user-sr3il7uo2j

    @user-sr3il7uo2j

    4 ай бұрын

    @@Cricket_AiNo I had to move into different db

  • @saiabhilash3151

    @saiabhilash3151

    3 ай бұрын

    1.Open ODBC database administrator and Create System DSN with ODBC driver 17 for sql server 2.Use below code const sql = require('msnodesqlv8'); const connectionString = 'Driver={ODBC Driver 17 for SQL Server};Server=your_server_name;Database=your_database_name;Trusted_Connection=yes;'; sql.open(connectionString, (err, conn) => { if (err) { console.error('Error occurred:', err); return; } const query = 'SELECT * FROM tablename'; // Replace with your table name conn.query(query, (err, results) => { if (err) { console.error('Error executing query:', err); } else { console.log(results); } conn.close(); }); });

  • @vinster-ti9ve

    @vinster-ti9ve

    3 ай бұрын

    @@saiabhilash3151 Thanks so much!!! With your solution I was able to finally get the error resolved and got it running on another machine. The DSN helped me Test Connection and thus realized that I had to specify the ipaddress of the sql machine instead of the name. Worked like a charm!!! 🙏

  • @saiabhilash3151

    @saiabhilash3151

    3 ай бұрын

    @@vinster-ti9ve All Thanks to chat gpt for providing solution 😉

  • @veenaanto7851
    @veenaanto7851 Жыл бұрын

    Any leads on how to connect with sql server db using Authentication Azure Active Directory - Universal with MFA

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    try the below code : /////////////////////////////////////////////////////////////// const sql = require('mssql'); const config = { server: 'your-server-name.database.windows.net', database: 'your-database-name', authentication: { type: 'azure-active-directory-access-token', options: { token: '', }, }, options: { encrypt: true, }, };

  • @rcasturi55
    @rcasturi55 Жыл бұрын

    When you close the db conn?

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    i had not closed but you can close at the end

  • @AshokKumar-kn4dl
    @AshokKumar-kn4dl Жыл бұрын

    hello Sir I am Getting This error Invalid object name 'WtAshok'

  • @2ndcode263

    @2ndcode263

    Жыл бұрын

    can you please share your code here www.linkedin.com/in/pawan-kumar-6a5994128/

  • @nijiln8823
    @nijiln8823Ай бұрын

    What is your Node version?

  • @thebhojpurideveloper4921

    @thebhojpurideveloper4921

    11 күн бұрын

    10

  • @20_omkar_kadu57
    @20_omkar_kadu579 ай бұрын

    ConnectionError: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified plz make a video on this

  • @diegoalzugaray6229

    @diegoalzugaray6229

    7 ай бұрын

    Have you found a fix to this?

  • @muruganamirthalingam6023

    @muruganamirthalingam6023

    5 ай бұрын

    I have the same issue. Please help me with this.

  • @saiabhilash3151

    @saiabhilash3151

    3 ай бұрын

    1.Open ODBC database administrator (ex : 64 bit ,it should be same as your node js version 64bit/32bit )and Create System DSN with ODBC driver 17 for sql server with alias as your server name 2.Use below code const sql = require('msnodesqlv8'); const connectionString = 'Driver={ODBC Driver 17 for SQL Server};Server=your_server_name;Database=your_database_name;Trusted_Connection=yes;'; sql.open(connectionString, (err, conn) => { if (err) { console.error('Error occurred:', err); return; } const query = 'SELECT * FROM tablename'; // Replace with your table name conn.query(query, (err, results) => { if (err) { console.error('Error executing query:', err); } else { console.log(results); } conn.close(); }); });

  • @benlahcensoufiane1589

    @benlahcensoufiane1589

    2 ай бұрын

    sameeee

  • @atle5153

    @atle5153

    Ай бұрын

    @@muruganamirthalingam6023 after hours searching, i finally fix it. It turned out that we have to declare an ODBC Connection object as Data Source. Go to Control Panel -> Admins Tool-> ODBC Data Source Administrator. Then In Tab System DSN, Click Add. Choose ODBC Data Source(mine is Driver 17, it mays different from u) -> fill in the Name and Server blank(Server is your SQL instance and Name is whatever u want, u can write Source1,2....) -> Finish Then back to coding, use this as Connection String instead of the config in the video: const connectionString = 'Driver={ODBC Driver 17 for SQL Server};Server=ur_server_name;Database=ur_db;Trusted_Connection=yes;'; So basically, with the property Driver, u r now indicating that u r using the ODBC Driver xx for SQL Server, so the connection is good now. Hope it helps