invalid objects tool script wrong object name

SQL prompt 10.6.1.17779 ssms version 15.0.18358.0  sqlserver 14.0.3335.7 database at compatibility 110

 I'm using find invalid objects (renaming some databases that cross query) and the displayed create (view) script is giving WRONG names for the views being examined. The bad names are also used in the generated ALTER scripts for the ALTER command, but surprisingly uses the correct name for a later exec sp_addextendedproperty  step.

An example is we have a broken view called dbo.VW_Vein1Ass 
In the invalid objects panel it correctly lists it as VW_Vein1Ass but in the script view at the bottom, it says " CREATE VIEW dbo.VV_Vein1Ass" . Using the script as alter it generates code that says "ALTER VIEW dbo.VV_Vein1Ass" 
Using the ssms script view as alter generates code "ALTER VIEW [dbo].[VW_Vein1Ass]"
This happens on a variety of view messing up the names in different ways, not just the prefix.
In one case it seems to have swapped names from one bad object to another in the script (script uses the name of the next bad object in the script and the next object script has the name of the view above) (corruption within the list of items, not just corruption of the single object name)

Any suggestions?
Sign In or Register to comment.