Edit

Share via


Code assistance for Copilot in SQL Server Management Studio

Copilot in SQL Server Management Studio (SSMS) offers code assistance which can accelerate productivity by helping you understand and fix queries faster. Highlight any query in the editor and right-click to view the available options.

Document assistant

The Document assistant returns an updated script in the chat window with a short summary of what the query does. It also adds comments to individual lines of code as appropriate. Documenting T-SQL can help the next person who looks at your code understand what you did.

Explain assistant

The Explain assistant provides in-depth details about each clause in the query (SELECT, FROM, etc.) in the chat window. The output appears in Markdown format for organization and easy review.

Fix assistant

The Fix assistant addresses any errors in the script and returns a corrected version of the script in the chat for you to review. The response includes an explanation of the issue and what was changed.

Refactor assistant

The Refactor assistant identifies anti-patterns in the query, and makes changes consistent with T-SQL best practices. The query is returned in the chat window with a description of improvements made in Markdown format.