T-SQL
We will create a Local T-SQL Database. These will be the most commonly used database in CSCN-326.
Create a new Local T-SQL Database
Pre-requisites
Steps
- Open a terminal and run the following command to pull the latest SQL Server image from Docker Hub
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=VeryStr0ngP@ssw0rd" -p 1433:1433 --name sql --hostname sql --platform linux/amd64 -d mcr.microsoft.com/mssql/server:2022-latest
- Check Docker to make sure the container is running
Connecting to the Local SQL Database
- Open Azure Data Studio and click
New Connection
- Enter
localhost
intoServer
- Enter
sa
intoUsername
- Enter
VeryStr0ngP@ssw0rd
intoPassword
- Click
Remember Password
- Click
Advanced
- Scroll down to
GENERAL
and put1433
intoPort
- Click
Connect
Username: sa
Password: VeryStr0ngP@ssw0rd
You should now be connected to your Local SQL Database.
From here, you can create a new database, create tables, and run queries. We recommend looking at the Azure Data Studio Documentation to learn more about Azure Data Studio.