Skip to main content

Connect and Execute T-SQL from VS Code

The MSSQL Extension for Visual Studio Code is designed to empower developers by providing a seamless and modern database development experience. The goal is to make SQL development more productive and intuitive by integrating essential features such as schema management, query execution, and AI-powered assistance.

Agents Inside VS Code

One of the most underrated strengths of the MSSQL Extension is how it leverages agents directly within Visual Studio Code. This isn’t just about running queries—it’s about having intelligent helpers embedded in your workflow.

  • Write Queries Faster: Agents can scaffold queries from natural language, explain stored procedures, and even suggest optimizations. Instead of memorizing syntax, you focus on intent, and the agent translates it into SQL.
  • Spot Performance Bottlenecks: Agents don’t just execute queries—they help you understand them. With execution plan insights and AI-driven recommendations, you can identify bottlenecks like slow joins or missing indexes before they become production headaches.
  • Stay in Flow: Because these agents live inside VS Code, you don’t need to switch tools or dashboards. Everything—from query writing to performance tuning—happens in one unified environment.

This is good because it transforms SQL development from a manual, error-prone process into a guided, intelligent experience. You’re not just coding—you’re collaborating with an assistant that knows your database context and helps you make smarter decisions.

Using the MSSQL Extension

Follow these steps to get started with the MSSQL extension:

  1. Install Visual Studio Code and then install the MSSQL extension from the Extensions view or via the command palette (F1, then type Install Extensions).
  2.   Click on SQL server or hit Ctrl+Alt+D from your keyboard to open the SQL Server window. Then click on Add connection.
  3. Add a database connection: 
    - Enter a Profile Name
    - Select the Parameters option under the Input name options
    - Enter the Server Name
    - Select SQL Login under the Authentication Type options
    - Enter the User name for connecting to the database
    - Enter the Password. (You can coose to Save Password)
    - Enter the Database name
    - Click Connect.

  4. Open a new query editor: Press Ctrl+N to open a new query editor, or right-click on your server and select New Query. 
  5. Type your query in the query editor and select Run:
    This query returns all records in the Customers in CustTable.
Click on Generate code or hit Ctrl + I  on your keyboard to generate queries using Agents in VS Code


Additional Resources to Get Started

Comments

Popular posts from this blog

User Security Governance (Preview) feature in D365 FO

Let's take a first look at User security governance . It is the latest set of features in the D365F&O 10.0.43 update which provides useful tools to System administrators for role management, licenses auditing, enhanced audit trails and versioning, supported with some useful very useful reports around license usage, separation of duties violations etc. Key aspects of this feature include: Role Management: Improved tools for creating, modifying, and managing user roles. Audit Trails: Enhanced tracking of changes made to security settings, helping administrators monitor and review security configurations. Compliance: Tools to ensure that security settings comply with organizational policies and regulatory requirements. Feature management A new feature called (Preview) User security governance has been added to Feature management to control the overall functionality. Navigate to System administration > Security > Security governance to explore all the features. Security analy...

Conditionally Hiding Menu Items in D365 FinOps Menus Without Using Feature Keys

In Microsoft Dynamics 365 Finance and Operations (D365 F&O), menu items are the links that can be clicked on to access forms, reports, classes, jobs, and queries. Feature keys are typically used to control the visibility of menu items based on user licenses. However, there are scenarios where you might want to hide menu items conditionally without relying on feature keys.  This can be accomplished by extending the 'SysMenuNavigationObjectFactory' class and modifying the checkAddSubMenu(...) method.  Suppose we want to hide the  Vendor payment journal menu item under Accounts payable > Payments > Vendor payment journal Steps 1. Create an extension of the SysMenuNavigationObjectFactory class [ ExtensionOf ( classStr (SysMenuNavigationObjectFactory))] internal final class SysMenuNavigationObjectFactory_PS_Extension { } 2. Create a Chain of Command (CoC) for the checkAddSubMenu method [ ExtensionOf ( classStr (SysMenuNavigationObjectFactory))] internal final...

Microsoft Dynamics 365 FSCM Licensing - New Multi-License Mapping on Menu Items

Licensing in enterprise systems has long been a game of mapping menu items to license types, ticking boxes, and hoping your role design didn’t trigger unexpected costs. But with the 2025 updates to Dynamics 365 Finance and Operations, Microsoft has flipped the script—ushering in a smarter, more flexible model that reflects how users actually work. Let’s break it down. In the legacy model, each menu item was tied to a single license type. For instance, if a user accessed MenuItemA that had a Finance license type on it, they needed a Finance license. If they accessed MenuItemB with SCM assigned on it, they needed SCM. Simple? Yes. But also rigid, prone to over-licensing, and blind to real-world role overlap. Example:  This model treated licensing like a static blueprint—ignoring the nuance of blended roles, attach licenses, and shared responsibilities across departments. Fast forward to 2025. Microsoft’s new licensing logic is object-level, dynamic, and context-aware. Now, a single m...