In continuation to my previous 2 blogs (Part 1, Part -2) on same topic, this is last in series. I’ll continue my experiment with SQL Server 2017 (on Linux) sitting on Mac Dockers. So far everything is working as expected and it’s time now to have a real fun with Microsoft Visual Studio placed on my Mac. After that I’ll be able to state, all Microsoft technologies are good to go hand in hand my Mac when it comes to database solutions building.
I’ve already install Microsoft Visual Studio on Mac. You can download from here. It’s pretty straightforward.
Next step to install mssql for Visual Studio Code
Connect in Visual Studio Code
After completing installation of mssql in VS Code, let’s begin with creating a new sql file.
- Press F1 to pull the command pallete
- Type MSSQL drop down list will show all commands related to keyword go for “MSSQL:Connect”
- Start putting parameter one by one as poped up.
- End create a profile so everytime you run and command against your SQL Server 2017 docker all configuration details are already saved. It will avoid to put same information at every instance/each query.
Server name: localhost Database name: master User name: sa Password: admin@123 [Save Password (yes or no)] Profile name: Mac-Docker
Same connection status is visibale at lower right hand corner of the IDE when it’s connected successfully. Something similar most of us are acquaintend in SSMS.
A simly on extreme right end confirms the success.
Play around with DB objects
Let’s quickly walkthrough how much similar VS Code is to SSMS. I’m going to create a database, a table, insert values and fetch them back. Very basic activity as it’s my first time with VS Code on Mac & of course for SQL Server 2017 docker on Mac OS.
select @@VERSION GO create database AvanishPanchal GO USE [AvanishPanchal] GO create table [SQLServerDocker] (nameOfDoc varchar(100)) GO insert into SQLServerDocker values ('FirstDockerOnMac-SQL2017RTM') GO SELECT * from SQLServerDocker GO
Wow! Things are pretty much similar with little fancy. So far so good and DevOps team is all set to go with development work without having any dependency on other groups, traditionally.
Regional Head – DataPlatformGeeks & DPS2017 Core Team Member
Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook
Follow Avanish Panchal on Twitter | Follow Avanish Panchal on FaceBook