I recently saw a question about the Azure Data Studio Intellisense: “Why won’t intellisense in Azure Data Studio work with different schemas?”
Immediately I thought, “Wait, it does.” But, testing is your buddy.
Azure Data Studio Intellisense
Azure Data Studio Intellisense is on by default. Also, I like it a little better than the one in SSMS because it will start trying to help you, as you type (like a 3rd party software I can’t live without). However, they’re partly right. Let’s say I want ‘Person.Address’ so I start typing like this:
It doesn’t know that I have a table named ‘Person.Address’. It’s trying to be helpful. You can even see how it’s doing a form of wild card search, suggesting that maybe ‘db_accessadmin’ is what I want since it has ‘a’ and ‘d’ in it.
Well, first, that’s how SQL Server Management Studio works too. It has to do with your default schema. By default, unless you specify otherwise, your schema will be ‘dbo’. The Intellisense in ADS & SSMS uses that to find tables for you. However, if you want other schemas, you have to do this:
You can see the ‘Person’ schema is right in front of me. Now if I hit ‘Enter’ (I haven’t change the defaults to work with space, not sure I want to) I’ll get the schema. Adding the dot:
Yeah, it’s a few extra key strokes, but it is working.
Questions like this come from two places. First, just some general ignorance about the importance of specifying your schema and how the default schema works. Second, they want it to do more for them than it currently can. I get it. I want it to figure out the schema for me (go follow that link up above), but it doesn’t do that. Once I provide the schema though, it’s clear sailing.