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
- Connecting to the SQL Server – show you how to create a Node.js program that connects to the SQL Server.
Section 2. Inserting Data
- Insert data into a table – show you how to insert data into a table in SQL Server from Node.js
- Import a CSV file into a table – learn how to read data from a CSV file and import it into a table in the SQL Server.
- Bulk Insert – discover how to perform a bulk insert in SQL Server from Node.js application.
Section 3. Updating Data
- Update data from a table – learn how to update data from a table from Node.js
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
- Delete data from a table – Show you how to delete data from a table in SQL Server from a Node.js application.
Section 6. Handling Transactions
- Perform a transaction – learn how to perform an SQL Server transaction from Node.js.
Section 7. Calling Stored Procedures
- Call a stored procedure – How to call a stored procedure from Node.js.
- Call a stored procedure with OUTPUT parameters – Show you how to call a stored procedure that has an OUTPUT parameter.
Section 8. Streaming data
- Stream – Learn how to handle a large data set efficiently using a stream.
Was this tutorial helpful?