Refresh Suggestions not working properly
rldawg
Posts: 35 Bronze 3
I upgraded to the latest version of SQL Prompt recently. If I alter a table or add a new proc or function and then do Refresh Suggestions, the new objects are not showing up in the suggestion list. I do not have the "Enable Automatic Refresh Suggestions" checked.
I am wondering if anyone else is having this issue?
Thanks
I am wondering if anyone else is having this issue?
Thanks
Comments
Is refresh suggestions not working at all or is it only under specific circumstances?
E.g. does it work in a really basic case of:
Thanks,
Aaron.
With a brand new database, I am unable to reproduce the behavior I was experiencing. I added a new table - refresh suggestions - OK. I altered the table and added a column - refresh suggestions - OK. I added a new scalar valued function - refreshed suggestions - OK
The database I was using yesterday has a considerable amount of database objects. We'll see if the results vary based on the number of objects.
It's a new day and I have relaunched SSMS and SQL Prompt. I will report back as the day goes along.
Thanks,
Aaron.
Thanks again
So this is what I did:
1. Added the new columns (in the middle of the column list, not at the end)
2. Refresh Suggestions -New columns did not show
3. Dropped the view
4. Refresh suggestions - Even though the view had been dropped it still shows in the suggestion list
5. Re-create the view
6. Refresh suggestions - View still shows in the suggestion list without the new columns
Based on what I see, it looks like under certain circumstances the cache of suggestions in not being refreshed properly. I have noticed that Refresh Suggestions is a lot faster than it used to be. Perhaps the process of Refresh Suggestions is skipping over some steps for the sake of speed and not updating all the necessary changes.
I really don't care that Refresh Suggestions takes a little longer for the sake of accuracy.
Thanks,
Robert
Were there any warnings or errors listed in the log?
It sounds like it's not refreshing the suggestions for the database at all so I'm wondering if it's refreshing the wrong database. Was the query you were using opened against the database or was it connected to another one (e.g master) with a USE statement or with a database qualifying the view?
If you'd rather clear the suggestions completely and start with a fresh cache you can disable and enable the suggestions (ctrl+shift+d twice)
Thanks,
Aaron.
I am sure that both query windows were pointed at the same database. The log file had nothing of note in it.
I will continue to monitor to make sure I didn't make a mistake like change a different view than the one I used in the query.
In my defense, I've used SQL Prompt for at least 7 years, and I'd say probably more like 9 years but I have no records to back that up. (I do remember using it with SQL 2000 at some point) So I am not a rookie user.
Nonetheless, I will continue monitoring and paying close attention.
Thanks,
Robert
I'm hoping it's just caused by some action that we're missing when we try to recreate it on our test machines. Once we can recreate it here it should be much easier to track down and fix.
For me, I've noticed that it takes some time (10 minutes maybe?) for the suggestions to be updated. I run "refresh suggestions" on a large database over a VPN. It might take 30 seconds for the refresh to complete. But the list of suggestions isn't actually updated until later. Immediately running refresh again doesn't help.
Is this something that's only recently started happening?
Thanks,
Aaron.
I most often notice this when adding new columns to a table which I then want to immediately use as part of a SELECT or INSERT. Although I have seen it happen when creating a new stored procedure, too. However, this is not consistent. I just attempted to recreate the problem on the same server and couldn't.
Yes, I think this is new in the past few months. Sorry, I can't narrow it much further than that.
This is not a trivial database but it's not huge, either. Here are the object counts.
81 CHECK constraints
2480 Default or DEFAULT constraints
439 FOREIGN KEY constraints
3 Inlined table-functions
1934 PRIMARY KEY or UNIQUE constraints
77 Scalar functions
1444 Stored procedures
67 System tables
13 Table functions
23 Triggers
2140 User tables
318 Views
I had to execute
Use MPDev
GO
Then when I did refresh suggestions, it refreshed the suggestions for the proper database MPDev.
Normally, switching the database dropdown list to a different database would trigger the suggestions to be refreshed to the different database.
Thanks,
Robert
Just registered to comment on this thread... I too have been experiencing these issues, though only for the last couple of weeks and prior to installing any updates (though I did update to the latest version from the previous latest version yesterday in an attempt to fix this issue).
Changing the database using the "USE" command or for the drop down did fix my suggestions once refreshing them so thank you to whoever provided that solution on this board.
However, I have noticed that the suggestions behaviour has changed recently and prior to the solution on this board I had been disabling and re-enabling SQLPrompt via the toolbar. Generally speaking if I followed this logic my intelligence started working properly again (but only for a short period of time):
Disable Code Suggestions Enable Code Suggestions Refresh Suggestions Disable Code Suggestions Enable Code Suggestions Refresh Suggestions
Then more often than not things would work again...
It would be nice to have the experience of things working how they used to once again......
Thanks!
Aaron.