https://github.com/codito/mssql-expt
Experiments with SQL Server on Linux
https://github.com/codito/mssql-expt
docker experiment mssql
Last synced: 8 months ago
JSON representation
Experiments with SQL Server on Linux
- Host: GitHub
- URL: https://github.com/codito/mssql-expt
- Owner: codito
- License: mit
- Created: 2019-01-11T01:57:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-01T12:43:34.000Z (about 2 years ago)
- Last Synced: 2025-02-24T16:56:11.610Z (about 1 year ago)
- Topics: docker, experiment, mssql
- Size: 66.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mssql-expt
Experiments with SQL Server on Linux
## Setup
Gets the docker image for SQL Server and connects to it from a command line
client.
```sh
> docker pull mcr.microsoft.com/mssql/server:2019-latest
# Create a new volume to hold sql data
> docker volume create 'sql2019'
# Start the container with volume attached
> docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Passw0rd' -p 1433:1433 --name sql1 --mount source=sql2019-d,destination=/mnt/data mcr.microsoft.com/mssql/server:2019-latest
```
Enumerate default databases in SQL server.
```sh
> docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'Passw0rd' -q 'select name from sys.databases'
name
--------------------------------------------------------------------------------------------------------------------------------
master
tempdb
model
msdb
(4 rows affected)
Sqlcmd: Warning: The last operation was terminated because the user pressed CTRL+C.
```
Server setup is complete.
## Azure data studio
Cross platform database management tool. Highly recommended.
Install from .
Try connecting to the docker instance and run a few queries.
Once it is setup, choose any task from below to learn more.
## Tasks
Each task talks about a topic and walks through some queries to explore. It will provide steps to perform database setup (as required).
- [Statistics in SQL Server](tasks/statistics.md)