Get started quickly with developing applications in Node.js on Ubuntu with SQL Server
About this sample
Before you begin
Run this sample
Sample details
Disclaimers
Related links
- Applies to: SQL Server 2016 (or higher)
- Workload:
- CRUD with Node.js
- CRUD with Sequelize ORM
- Performance improvements with Columnstore
- Programming Language: JavaScript
To run this sample, you need the following prerequisites.
Software prerequisites:
- SQL Server 2016 (or higher)
- Node.js
- Sequelize ORM
- A text editor
- sql-cli
-
Create the database to be used for the rest of the samples. From your command prompt, run the following. Update the username and password with your own.
mssql -s localhost -u sa -p your_password -q "CREATE DATABASE SampleDB;"
-
In your favorite text editor, open the connect.js file in the SqlServerSample folder and update the connection string username and password with your own.
-
From your terminal, run the project by performing the following command:
node connect.js -
From sql-cli, create the sample data to be used in the CRUD sample. Update the username and password with your own.
mssql -s localhost -u sa -p your_password -d SampleDB -T 60000 .run ./CreateTestData.sql -
From your terminal, run the CRUD sample by performing the following command:
node crud.js
-
In your favorite text editor, open the orm.js file in the SqlServerSequelizeSample folder and update the connection string username and password with your own.
-
From your command prompt, connect to your database and then create the sample data to be used in the columnstore sample. Update the username and password with your own.
node orm.js
-
In your favorite text editor, open the columnstore.js file in the SqlServerColumnstoreSample folder and update the connection string username and password with your own.
-
From your command prompt, connect to your database and then create the sample data to be used in the columnstore sample. Update the username and password with your own.
mssql -s localhost -u sa -p your_password -d SampleDB -T 60000 .run ./CreateSampleTable.sql -
From your terminal, run the CRUD sample by performing the following command:
node columnstore.js
Please visit the Node.js on Ubuntu tutorial to run through the sample in full with more detail.
The scripts and this guide are provided as samples. They are not part of any Azure service and are not covered by any SLA or other Azure-related agreements. They are provided as-is with no warranties express or implied. Microsoft takes no responsibility for the use of the scripts or the accuracy of this document. Familiarize yourself with the scripts before using them.
For more information, see these articles:
- To see more getting started tutorials, visit our tutorials page