Skip to main content

Connecting to SQL Server on a Mac

A
Written by Alex Salb
Updated over 4 months ago

Installing Visual Studio Code

  1. Download VS Code

  2. Install VS Code

    • Open the downloaded file

    • If the browser will not let you open the file because it doesn’t have the application to open it, Drag the Visual Studio Code download outside of the browser and open it from there

Installing SQL Server Extension

  1. Open Extensions View

    • In VS Code, press Cmd+Shift+X or click the Extensions icon in the left sidebar (it looks like stacked blocks)

  2. Install SQL Server (mssql) Extension

    • Search for "SQL Server (mssql)"

    • Look for the official extension by Microsoft

    • Click "Install”

Connecting to SQL Server

  1. Create a new file

    • Hit Cmd+n

  2. Open Command Palette

    • Press Cmd+Shift+P

  3. Create Connection

    • Type "MS SQL: Connect" in the textbox and select it

    • Select “Yes” from the textbox to set the language to SQL

    • Type “SQL” in the textbox and select it

    • Select “+ Create Connection Profile” from the textbox to create a new connection

  4. Create Connection (Continued)

    • Create a Profile Name

    • For Connection Group, leave it on “<Default>”

    • For Input Type, leave it on “Parameters”

    • Enter the Server Name, this is unique to each company

    • For Trust Server Certificate, select the checkbox

    • For Authentication Type, select “Microsoft Entra ID – Universal with MFA Support” from the dropdown menu

    • Under Microsoft Account, select the Sign in box

      • This will bring you to a web browser that will let you sign into your Microsoft account

      • Once signed in, navigate back to Visual Studio Code

    • For Tenant ID, select “3 tenets Optimization” from the dropdown menu

    • Database Name can be left blank

    • For Encrypt, leave it as “Mandatory”

    • Hit Connect, then hit Open to start the authentication process

      1. Log in to your Microsoft account

      2. Then approve the login with MFA

    • You should now be connected!

Did this answer your question?