Intellisense not updating after USE statement

Using SQL Prompt 9.0.6.3580 from inside Visual Studio 2015... If I open a SQL file, and then choose a connection from my history, SQL Prompt provides proper Intellisense for my default database A. However, if I try to switch to database B with the "USE" command, it doesn't detect the change, and still provides Intellisense for the initial database A. If I then use the database dropdown at the top of the SQL window to switch databases to another database (any database) and then back to database B, the Intellisense works correctly.

Is this a known issue?
Tagged:

Answers

  • RichardLRichardL Posts: 417 Gold 4
    Hi @mbray

    Thanks for your post and apologies that it has slipped through our net. 

    I hope that you aren't still experiencing difficulties but if you are please try the latest version which is linked below for you. 

    ftp://support.red-gate.com/patches/SQLPrompt/18Apr2018/SQLPrompt_9.1.8.4871.exe

    Kind regards

    Richard Lynch. 
    Customer Support
    Redgate Software
  • mbraymbray Posts: 9 Bronze 1
    edited April 23, 2018 1:47PM
    Hi Richard, thanks.   I installed the new version, verified it is running in Visual Studio, but I'm still seeing the issue.  Note that this issue does not occur in SSMS - only in Visual Studio.

    Here's a more specific set of procedures to reproduce:
    1. In Visual Studio, open a new file using the template "Sql File"
    2. Use the connect button to connect to a database (I simply pick one from my history)
    3. Type "ALTER PROCEDURE" (or "AP" shortcut) and hit space - the list of procedures from the current database are listed
    4. Clear the text, then type "USE <someOtherDatabase>" and execute.  Note that the database dropdown should now list "<someOtherDatabase>" as the current database.
    5. Clear the text, then type "ALTER PROCEDURE" (or "AP" shortcut) and hit space...   the list of procedures in the intellisense dropdown are the same ones as listed previously, not the procedures from the new database
    6. OPTIONALLY...   manually switch the database back to the original using the database dropdown selector, then back to <someOtherDatabase".  Now, repeating step 5, the intellisense dropdown list is correct.
    Contrast this with manually switching the database, which works correctly:
    1. In Visual Studio, open a new file using the template "Sql File"
    2. Use the connect button to connect to a database (I simply pick one from my history)
    3. Type "ALTER PROCEDURE" (or "AP" shortcut) and hit space - the list of procedures from the current database are listed
    4. Clear the text, then click the database dropdown list to select <someOtherDatabase>
    5. Type "ALTER PROCEDURE" (or "AP" shortcut) and hit space...   the list of procedures in the intellisense dropdown is correctly listed as the procedures from the new database

  • mbraymbray Posts: 9 Bronze 1
    Submitted Request #112188. 
Sign In or Register to comment.