![]() If you do this more than a few times a year, definitely automate the restore process using T-SQL or PowerShell! I use the following, standard script: Mission accomplished □ Restore Demo Databases Script How cool is that? Just repeat the process for any remaining databases. Yay! The WideWorldImporters demo database is now restored to SQL Server 2019 running in a Docker container: ( Do you know? Please comment!) I can only guess that since SSMS is a Windows application, it is using Windows paths (with backslashes), even though it is showing the Linux paths (with forward slashes). I have no idea why, and I haven’t figured out if this is a bug or by design. When I ran the container, I also mapped my local folder C:\Docker\SQL to the container path /sql. The current path is using forward slashes. ![]() If you open Restore Database from SQL Server Management Studio (SSMS) and navigate to Locate Backup File, you will see the /var/opt/mssql/data path: I had already downloaded the AdventureWorks and WideWorldImporters .bak files to my C:\Docker\SQL\Backup folder. If you specified a different port when running the container, you will have to connect using the port number, for example localhost,1401 Restoring Demo Databases You can now connect from SQL Server Management Studio (SSMS) to your container as SA using your : Once you have Docker installed, pull the SQL Server 2019 image by executing the following code in PowerShell: It worked pretty well for me! See below □□ I decided to start with his walkthrough and do exactly what he did. But! I’m lucky to have smart friends □ Andrew Pruski ( wrote Running SQL Server 2019 CTP in a Docker container as part of his brilliant blog post series on containers. I knew nothing about Docker or containers a month ago. Restoring Demo Databases (AdventureWorks and WideWorldImporters).Running SQL Server 2019 in a Docker Container.In this post, I share my approach and code snippets for: It was more like “oops, I accidentally deleted my container”.) ( Why did I have to set up everything again? Oh, it’s a long story that involves disk cleanup and a Cathrine who likes to delete things to keep her computer tidy. It was the perfect opportunity to update the content and finally publish this post. This weekend, I had to set up my demo environment again. Then I got distracted and never finished it. While learning, I started writing this blog post. I learned how to run SQL Server 2019 in Docker and how to set up my demo environment in a container. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |