In SQL Server Management Studio if the user creates new table columns, tables, etc. the user needs to refresh the IntelliSense cache using CTRL+Shift+R.
Is there a setting or some way to automate this so it can automatically be refreshed right after inserting a new table, etc?
With your focus in the Query window, press Ctrl+Shift+R. This will refresh your cache and now your query will be happy with you.
How to Enable IntelliSense Feature in SSMS. Open SSMS, click Tools -> Options -> Expand Text Editor -> Expand Transact-SQL and click on IntelliSense as shown in the snippet below. Under Transact-SQL IntelliSense Settings ensure “Enable IntelliSense” checkbox is enabled.
To clear SQL Server's cache, run DBCC DROPCLEANBUFFERS , which clears all data from the cache. Then run DBCC FREEPROCCACHE , which clears the stored procedure cache.
I don't know that there is a way to automatically refresh the cache without manually pressing Ctrl+Shift+R (or equivalent, e.g. the menu). The reason is that when the app talks to the database too much, people complain that it is too chatty (perhaps someone could write a simple add-in that does this - using something like query notifications to indicate something has changed in the metadata views?). You may also want to consider an add-on like SSMS Boost (though with a quick keyword search I see no mention of this functionality on its feature page) or SQL Prompt (but also I don't see any evidence of this functionality in their documentation, only a mention here of an experimental feature).
I believe SQL Server Data Tools does this, but I don't know if you can control the frequency of the refresh. And using that tool may also require a significant shift in how you think about database development.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With