Modify view > Open query to console does not pull code for the correct view


When I right click a view > Modify View > Open query to console, the ALTER VIEW statement and code appears, but for the wrong view.

I have tried this with 9 different views and it always generates the code for the same view. Furthermore, the code it is generating is not the most recent code for that view.

How can I get the correct code to generate?



Could you please attach screenshots demonstrating the issue? It seems to work fine on my side.


Yes, I have attached the screenshots; hopefully it still makes sense with the info redacted.

When I right click and select modify view on the view ag_____vw, I click the "open query to console" button as shown in the red circle.


What is populated in the new query window is the code for a different view, qu____vw. This is my first issue, as this is not the view I clicked on and not the view I want the code for.

Here is a snippet of the code that appears under this ALTER VIEW command:

This is not the correct code. When I right click on qu___vw and generate the DDL:

This is the same section of code, with the correct and most recent update:

Let me know if that makes sense.


Thanks for the screenshots.

Seems there are two points:

1. "Open in console" uses some cached console and it seems to be a bug.

2. When there are no changes in view then "Preview" is also empty and no code is shown in console. Please try to change view - it will fill "Preview" with code and it should be also shown in console.


I guess I don't understand the second point. When I change the name of the view, there is code generated in the preview box to change the view name. If I click OK, it changes the name of the view and closes, but if I click "open query to console" after changing the view name it still generates the code for the incorrect view.


Please sign in to leave a comment.