It is time to practice T-SQL but how can I do that with my Macbook Pro? Thanks to Docker, it is never mission impossible.

  • Steps
    1. Follow the post to install docker and create a container with SQL Server 2019 CTP.

    2. Install Azure Data Studio and read the post

    3. Download Wide World Importers sample database (WideWorldImporters-Full.bak) and change the code on the post to the following code to restore Wide World Importers sample database to the docker container

      RESTORE FILELISTONLY FROM DISK = '/var/backups/WideWorldImporters-Full.bak'
      GO
      
      RESTORE DATABASE WideWorldImporters FROM DISK = '/var/backups/WideWorldImporters-Full.bak' 
      WITH 
      MOVE 'WWI_Primary' TO '/var/opt/mssql/data/WideWorldImporters.mdf',
      MOVE 'WWI_UserData' TO '/var/opt/mssql/data/WideWorldImporters_UserData.ndf',
      MOVE 'WWI_Log' TO '/var/opt/mssql/data/WideWorldImporters.ldf',
      MOVE 'WWI_InMemory_Data_1' TO '/var/opt/mssql/data/WideWorldImporters_InMemory_Data_1'
      GO

    4. Then, It works! If we want to see the files in the container, we can install Kitematic to talk to the container with command.