15

As far as I can see the only options currently for copilot/ChatGPT SQL assistance is to generate queries outside of SSMS.

The real power would be within the SSMS, with access to table definitions, SP's etc. I could see this saving me hours of dev time. Anyone know if there's anything on the cards or whether MS allows for external tools to be incorporated into SSMS?

5
  • 3
    This is probably the best example I've seen of lack of research my advice to anyone else who is going to post questions about openAI is to ask it first... Commented Jun 9, 2023 at 1:41
  • @ChrisSchaller so if you consider this question lack of research, why up-vote it? Down-vote is for lack of research. Commented Jun 9, 2023 at 1:51
  • 3
    @ChrisSchaller, Dale K I appreciate the concern for people posting 101 openAI questions without first researching, however I think you've falsely categorised me :) I'm not using SSDT or Azure Data Studio. I'm using SSMS. I've already read about the support both of these have but nothing on SSMS, hence why I posted. Commented Jun 9, 2023 at 1:55
  • To be honest, its not a valid question for this site, its not about programming, its about tools - which is off topic. Commented Jun 9, 2023 at 1:58
  • Any add ins like this are likely to be implemented in Azure Data Studio, not SSMS. Or whatever web dev tool exists in Fabric / Synapse Commented Jun 9, 2023 at 3:55

3 Answers 3

8

After some research, I ended up using the 'SQL Server (mssql) VSC extension which you can install here https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql

To save a bunch of googling here's what I did to get up and running.

  1. Install the extension.

enter image description here

  1. Create and save a new *.sql file in your explorer somewhere (the below won't work unless a .sql file has focus

ctrl+shift+P - select MS SQL: Connect

enter image description here

  1. Paste in the connection string (from your appsettings.json etc) - press enter through everything else if you like.

You should now see your database in the SQL Server tab in the left pne.

enter image description here

Right click your DB to create a new query.

enter image description here

Click the green play button to run the query (do not use F5)

enter image description here

Not a perfect approach but good enough for some quick SQL debugging and can never remember how to insert a record etc.

Sign up to request clarification or add additional context in comments.

4 Comments

"Not a perfect approach" .... hmmm I think this is a perfect approach. I 99% migrated from SSMS to vs-code 2 years ago and do not miss SSMS
Thanks for this. Going to give it a shot. It's going to be hard to lose the F5 muscle memory.
@whytheq are you using the mentioned "SQL Server (mssql)" extension? I would sure like to try whatever you say can get rid of the clunky SSMS.
@KenHadden yes I am using the mssql in VS Code - the extension already has many features and MS are doing a great job of regularly adding more functionality to this extension
3

Only way right now is to get Azure Data Studio and install copilot

Comments

0

They have announced Copilot for SSMS in private preview.

Copilot in SSMS will start with a chat for the Query Editor, leveraging both connection and database context to answer your general SQL questions and help you write T-SQL based on natural language prompts.  For NLtoSQL prompts, Copilot queries the database metadata to provide context about the tables and views in your database, and it can also assist with fixing and explaining T-SQL queries.

https://techcommunity.microsoft.com/blog/sqlserver/announcing-sql-server-management-studio-ssms-21-preview-1-and-copilot-in-ssms/4286966

SSMS 22 is the preferred way to use Copilot

https://learn.microsoft.com/en-us/ssms/github-copilot/chat

1 Comment

I agree that ssms even the latest version is not productive for even minor change, one use use alter table alter... etc query to get simple changes. yes copilot helps a lot but sometimes it brings a lot chaty stuff

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.