CodePilot在SQL Server SSMS中

huangapple go评论73阅读模式
英文:

CodePilot inside SQL Server SSMS

问题

目前,就我所知,Copilot/ChatGPT SQL 助手的唯一选项是在 SQL Server Management Studio (SSMS) 之外生成查询。

真正的强大功能应该在 SSMS 内部实现,可以访问表定义、存储过程等。我可以看到这样的功能可以节省我大量的开发时间。有人知道是否有这方面的计划,或者微软是否允许将外部工具集成到 SSMS 中吗?

英文:

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?

答案1

得分: 1

经过一些研究,我最终使用了 'SQL Server (mssql) VSC 扩展,你可以在这里安装:https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql

为了节省一些搜索时间,以下是我用来启动和运行的步骤:

  1. 安装这个扩展。

  2. 在资源管理器中创建并保存一个新的 *.sql 文件(如果没有焦点在一个 .sql 文件上,下面的步骤将无法工作)。

  3. 按下 ctrl + shift + P,选择 MS SQL: Connect。

  4. 粘贴连接字符串(从你的 appsettings.json 等文件中复制)- 如果愿意,可以按下 Enter 完成其他操作。

现在,你应该可以在左侧的 SQL Server 选项卡中看到你的数据库。

右键单击你的数据库以创建一个新查询。

单击绿色的播放按钮来运行查询(不要使用 F5)。

虽然不是完美的方法,但足够用于一些快速的 SQL 调试,我经常忘记如何插入记录等操作。

英文:

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.

CodePilot在SQL Server SSMS中

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

<kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>P</kbd> - select MS SQL: Connect

CodePilot在SQL Server SSMS中

  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.

CodePilot在SQL Server SSMS中

Right click your DB to create a new query.

CodePilot在SQL Server SSMS中

Click the green play button to run the query (do not use <kbd>F5</kbd>)

CodePilot在SQL Server SSMS中

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

答案2

得分: -1

SQL Server Developer Tools Gets an AI Copilot

SSMS最初是构建在Visual Studio Shell之上的,即使到今天,它仍然保留了丰富的可扩展性框架。

外部工具 - SQL Server Management Studio

我不禁想知道为什么你没有自己将这个提示放入Chat GPT中:

可以让Copilot帮助我在SSMS中生成SQL查询吗?

是的,您可以在SSMS中使用GitHub Copilot来生成SQL查询。GitHub Copilot是一款基于人工智能的合作编程工具,可以为您提供具有上下文感知的代码完成、建议,甚至整个代码片段。它现在可用于Azure Data Studio 1.

要在SSMS中使用它,您可以安装Visual Studio Code的GitHub Copilot扩展,然后使用SQL Server Object Explorer 1连接到SSMS。

希望这对您有所帮助!如果您有其他问题,请告诉我。

英文:

Even SQL Server Developer Tools Gets an AI Copilot

SSMS was originally built on top of the Visual Studio Shell, even to this day it retains a rich extensibility framework

External Tools - SQL Server Management Studio

I can't help but wonder why you didn't put this prompt into chat gpt yourself:

can i get copilot to assist me generate sql queries in SSMS

> Yes, you can use GitHub Copilot for SQL queries in SSMS. GitHub Copilot is an AI-powered pair programmer that assists you with context-aware code completions, suggestions, and even entire code snippets. It is now available for Azure Data Studio 1.
>
>To use it in SSMS, you can install the GitHub Copilot extension for Visual Studio Code and then connect to SSMS using the SQL Server Object Explorer 1.
>
>I hope this helps! Let me know if you have any other questions.

huangapple
  • 本文由 发表于 2023年6月9日 09:27:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76436635.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定