Node.js SQL Server

This tutorial series shows you how to interact with the SQL Server from Node.js using the mssql package.

The mssql package has the following main features:

  • Multiple authentication methods: supports Windows and SQL Server Authentication, providing flexibility for connecting to SQL Server.
  • Connection pooling: efficiently manages multiple database connections, enhancing database performance and server resource utilization.
  • Parameterized queries: offers a secure way to execute queries with external inputs, allowing you to prevent SQL injection attacks.
  • SQL queries and stored procedures: allows you to execute SQL queries and stored procedures, covering a wide range of SQL Server operations.
  • Streaming: supports large result sets by streaming data in chunks, helping reduce memory consumption.
  • Transaction Management: supports transaction handling, ensuring data integrity and consistency for complex operations.
  • Detailed error handling and logging: provides detailed error handling and logging features, making troubleshooting easier.

You should follow the tutorial in sequence for the best experience.

Section 1. Getting Started #

Section 2. Inserting Data #

Section 3. Updating Data #

Section 4. Querying Data #

  • Select data from a table – Guide you on how to select one or more rows from a table in Node.js
  • Pagination – Show you how to break up a large dataset into smaller chunks (pages) using FETCH and OFFSET clauses.

Section 5. Deleting Data #

Section 6. Handling Transactions #

Section 7. Calling Stored Procedures #

Section 8. Streaming data #

  • Stream – Learn how to handle a large data set efficiently using a stream.
Was this tutorial helpful?