How to Help Copilot Encourage Good Database Standards

AI
11 Comments

I know a lot of y’all lag behind on upgrading SSMS, but v22.3 just introduced something that you need to be aware of. It’s going to impact any of your users who DO upgrade their SSMS, or who use Github Copilot. There’s something that you can do in order to improve Copilot’s code quality and make it match your preferred coding standards.

You can add database instructions as extended properties at the database or object level, and when Copilot works with those objects, it’ll read your instructions and use them to shape its advice.

For example, you can add a database-level property called a “constitution” with your company’s coding standards, like this:

Neato, huh? You can also define guidance at the object level:

Then, when SSMS Copilot or Github Copilot query the database schema to understand it, they’ll automatically read the Constitution.md and Agents.md properties, and take that into account when generating code for you. (It doesn’t work quite right just yet – you have to manually prompt it to go read the advice in v22.3 – but it’s clear that Microsoft intends it to work automatically without being reminded.)

That’s brilliant and I love it!

In a perfect world, this is going to let us define database & coding standards, check them into source control as part of our database schema, and when developers ask Copilot for code reviews or to write new queries & tables, our teams will actually get meaningful advice!

But at the same time, it poses a risk. If anyone adds extended properties to your databases, they can shape the advice you get from AI. That means it’s up to you, dear reader, to spearhead the drive for good coding standards in your databases, and make sure other people don’t steer the code in the wrong direction.

Here’s how to see what AI advice constraints have been set up in a database:

We’ve also added CONSTITUTION.md support to the First Responder Kit in the dev branch if you’d like to get a sneak peek before the May 2026 release. Our free health check script, sp_Blitz, warns you if someone’s added AI guidance at the database or object level, and sp_BlitzCache adds the CONSTITUTION.md guidance when building AI prompts for you, so your code standards are followed by ChatGPT.

Previous Post
[Video] Office Hours at Atlantis, Bahamas

11 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.