13

Okay. So I'm breaking some new ground and trying to get into Azure Data Studio. I'm having a problem with intellisense that seems to be a bug with Azure Data Studio but I'm not sure.

I have issues with basic queries. Foreign keys, select statements and insert statements are all telling me in this example that chocolate_category does not exist, it says it is an invalid object name, or that the foreign key is invalid because the table name is invalid, etcetera.

Simply put ADS is erroring on tables that do in fact exist. In this case, I was able to insert data even though the intellisense thinks the table name is invalid. Then I was able to select from the table.

Why is this happening and how can I fix this? Control-Shift-R does not work to refresh intellisense. Adding dbo. prefix to the table name does not work either.

As you can clearly see in this image, the table exists within the database that I'm located. The query shows an error, however running it puts up a result. If my code works on the table name, then why the error?

I have found that it is possible to continue through this error, but it is very annoying to me to be told something is broken that is not broken.

enter image description here

2 Answers 2

26

The CTRL+SHIFT+R shortcut to refresh the IntelliSense cache is the correct shortcut in SSMS, but does not work in ADS.

To do this in ADS, press CTRL+SHIFT+P to bring up the Command Palette, and type intellisense. The drop down list will filter so you can select Refresh IntelliSense Cache from the listed options. (Either arrow to it and hit Enter or select with your mouse.

You can add your own keyboard shortcuts to ADS so the the familiar CTRL+SHIFT+R combination works for you on your machine.

0
0

You have to let the gui know what Schocolade_Factory is.

As the database, will not search for in aall database that it has, which would need some time for every keystroke

so if you write

   SELECT * FROM dbo.Schocolade_Factory

A further possibility

is to use the database name before the table

SELECT * FROM [SchocladeSales].[Schocolade_Factory]

in bith case you tell the gui, what Schocolade_Factory is and where it can find information like columns name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.