DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How to Recover a Deleted Table in a SQL Server Database
  • Restoring the MS SQL Server Database in Easy Steps
  • How To Convert MySQL Database to SQL Server
  • Data Transfer From SQL Server to Excel

Trending

  • Start Coding With Google Cloud Workstations
  • Is Agile Right for Every Project? When To Use It and When To Avoid It
  • Automating Data Pipelines: Generating PySpark and SQL Jobs With LLMs in Cloudera
  • Automatic Code Transformation With OpenRewrite
  1. DZone
  2. Data Engineering
  3. Databases
  4. SQL With Visual Studio Code

SQL With Visual Studio Code

SQL Management Studio can be... a bit of a beast. Let's see how to use Visual Code Studio instead in order to write SQL queries.

By 
Simon Foster user avatar
Simon Foster
·
Nov. 08, 17 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
108.4K Views

Join the DZone community and get the full member experience.

Join For Free

Writing SQL queries is typically done with SQL Management Studio (SSMS). However, this tool is a bit of a beast, so let's look at how you could use Visual Studio Code instead.

Visual Studio Code is a free text editor — but it is so much more than just a text editor. Let's see how. (By the way, VS Code can be downloaded from here.)

To work with SQL Server, download the MS SQL extension. Press CTRL + SHIFT + P, select Install Extension, and type mssql.

Intellisense in Visual Studio Code is brilliant — better than SSMS. Let's look at how to get it all set up.

Create a new file and set the language type to SQL (press CTRL + K + M).

Open the command palette with CTRL + SHIFT + P and type SQL to show the MS SQL commands. Select the Connect command.

Then, select Create Connection Profile. This creates a profile to connect to your SQL Server. Follow the prompts to get it all set up.

Look in the bottom right corner of the status bar and you should see that you are connected!

Now, if you type sql, you will see a long list of SQL code snippets that you can use:

Choose a snippet to create and edit it as required. When you are happy, press CTRL + SHIFT + E to execute.

This is basically all there is to it! However, this is an incredibly powerful way of working; the Intellisense instantly tells you what database objects you can use in your query, and there is a wealth of different snippets you can use.

When returning data, you get a similar view to SSMS, but you can save as Excel, CSV, or JSON.

SSMS is a very graphical way of doing things. You can double-click a table and see its columns or indexes. VS Code relies on T-SQL commands, but you have access to exactly the same information.

For more information about VS Code and the MS SQL extension, check out this documentation.

Visual Studio Code sql Microsoft SQL Server

Published at DZone with permission of Simon Foster, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Recover a Deleted Table in a SQL Server Database
  • Restoring the MS SQL Server Database in Easy Steps
  • How To Convert MySQL Database to SQL Server
  • Data Transfer From SQL Server to Excel

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!