SQL Prompt does not recognize database context change
Dave Pendleton
Posts: 104 Bronze 3
My SQL Prompt install (while in SMSS) does not recognize database context changes when performed by the toolbar/dropdown. The scenario usually goes something like this:
1. Open Query Window in msdb.
2. Type and execute some SQL, prompting works as expected.
3. Change database context using the toolbar (not a USE statement).
4, Type some SQL, no database-specific prompting appears for the new database context; system variables, functions, and syntax still work as expected.
I have to close the Query Window and reopen to get database-specific prompting to work. Refresh Suggestions has no effect.
1. Open Query Window in msdb.
2. Type and execute some SQL, prompting works as expected.
3. Change database context using the toolbar (not a USE statement).
4, Type some SQL, no database-specific prompting appears for the new database context; system variables, functions, and syntax still work as expected.
I have to close the Query Window and reopen to get database-specific prompting to work. Refresh Suggestions has no effect.
Comments
I'm not sure why this is not working for you with SQL Prompt 4. I have tried it out myself by writing a select statement, changing the database dropdown, and typing a second SELECT query, which will then suggest table candidates from the newly-selected database.
Maybe it would help if you let us know the version of Prompt you use, and the exact steps to reproduce the problem.
Thanks!
The steps are documented in my first post.
SELECT * from ...
then, after changing the context, select * from...
In each case I got the list of candidates from the correct database.